diff --git a/.gitmodules b/.gitmodules index 0fe39efc..5a5a797b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "wasmd"] path = wasmd url = https://github.com/CosmWasm/wasmd.git -[submodule "ibc-go"] - path = ibc-go - url = https://github.com/cosmos/ibc-go diff --git a/Cargo.lock b/Cargo.lock index 5b70bca7..c88a3588 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,6 +32,18 @@ version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "async-stream" version = "0.3.5" @@ -51,7 +63,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -62,7 +74,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -177,6 +189,28 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -240,12 +274,28 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +dependencies = [ + "num-traits", + "serde", +] + [[package]] name = "const-oid" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "core-foundation" version = "0.9.3" @@ -266,8 +316,11 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" name = "cosmos-sdk-proto" version = "0.20.0" dependencies = [ + "ics23", + "informalsystems-pbjson", "prost", - "prost-types", + "prost-wkt-types", + "serde", "tendermint-proto", "tonic", ] @@ -451,6 +504,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "erased-serde" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4adbf0983fe06bd3a5c19c8477a637c2389feb0994eca7a59e3b961054aa7c0a" +dependencies = [ + "serde", +] + [[package]] name = "errno" version = "0.3.4" @@ -573,7 +635,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -801,6 +863,25 @@ dependencies = [ "tokio-io-timeout", ] +[[package]] +name = "ics23" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3b8be84e7285c73b88effdc3294b552277d6b0ec728ee016c861b7b9a2c19c" +dependencies = [ + "anyhow", + "blake2", + "blake3", + "bytes", + "hex", + "informalsystems-pbjson", + "prost", + "ripemd", + "serde", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "idna" version = "0.4.0" @@ -837,6 +918,34 @@ dependencies = [ "hashbrown 0.14.1", ] +[[package]] +name = "informalsystems-pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "informalsystems-pbjson-build" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bd45cde4e45f1f214ae854eeee74ebfe67871c6dc6cc0b5f7cb87b513f0d318" +dependencies = [ + "heck", + "itertools 0.12.0", + "prost", + "prost-types", +] + +[[package]] +name = "inventory" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8573b2b1fb643a372c73b23f4da5f888677feef3305146d68a539250a9bccc7" + [[package]] name = "ipnet" version = "2.8.0" @@ -852,6 +961,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -879,6 +997,15 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "libc" version = "0.2.148" @@ -943,13 +1070,13 @@ checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1064,7 +1191,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1102,7 +1229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.37", + "syn", ] [[package]] @@ -1132,7 +1259,7 @@ checksum = "8bdf592881d821b83d471f8af290226c8d51402259e9bb5be7f9f8bdebbb11ac" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.10.5", "log", "multimap", "once_cell", @@ -1141,7 +1268,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.37", + "syn", "tempfile", "which", ] @@ -1153,10 +1280,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1168,10 +1295,57 @@ dependencies = [ "prost", ] +[[package]] +name = "prost-wkt" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d8ef9c3f0f1dab910d2b7e2c24a8e4322e122eba6d7a1921eeebcebbc046c40" +dependencies = [ + "chrono", + "inventory", + "prost", + "serde", + "serde_derive", + "serde_json", + "typetag", +] + +[[package]] +name = "prost-wkt-build" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b31cae9a54ca84fee1504740a82eebf2479532905e106f63ca0c3bc8d780321" +dependencies = [ + "heck", + "prost", + "prost-build", + "prost-types", + "quote", +] + +[[package]] +name = "prost-wkt-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435be4a8704091b4c5fb1d79799de7f2dbff53af05edf29385237f8cf7ab37ee" +dependencies = [ + "chrono", + "prost", + "prost-build", + "prost-types", + "prost-wkt", + "prost-wkt-build", + "regex", + "serde", + "serde_derive", + "serde_json", +] + [[package]] name = "proto-build" version = "0.1.0" dependencies = [ + "informalsystems-pbjson-build", "prost", "prost-build", "regex", @@ -1502,7 +1676,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1524,7 +1698,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1563,6 +1737,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + [[package]] name = "signature" version = "2.1.0" @@ -1639,17 +1823,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.37" @@ -1749,8 +1922,7 @@ dependencies = [ [[package]] name = "tendermint-proto" version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" +source = "git+https://github.com/informalsystems/tendermint-rs?branch=romac/missing-serde-proto#84a8711bfbaa5f7d0afc46d0deb24373040ce326" dependencies = [ "bytes", "flex-error", @@ -1813,7 +1985,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1893,7 +2065,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -1977,7 +2149,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -2032,7 +2204,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] [[package]] @@ -2056,6 +2228,30 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "typetag" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "196976efd4a62737b3a2b662cda76efb448d099b1049613d7a5d72743c611ce0" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eea6765137e2414c44c7b1e07c73965a118a72c46148e1e168b3fc9d3ccf3aa" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "unicode-bidi" version = "0.3.13" @@ -2152,7 +2348,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn", "wasm-bindgen-shared", ] @@ -2186,7 +2382,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2343,5 +2539,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn", ] diff --git a/Cargo.toml b/Cargo.toml index 8f6cd616..8af33b12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,3 +5,6 @@ members = [ "cosmos-sdk-proto", "cosmrs" ] + +[patch.crates-io] +tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", branch = "romac/missing-serde-proto" } diff --git a/cosmos-sdk-go b/cosmos-sdk-go index d6d92984..9acdbb94 160000 --- a/cosmos-sdk-go +++ b/cosmos-sdk-go @@ -1 +1 @@ -Subproject commit d6d929843bbd331b885467475bcb3050788e30ca +Subproject commit 9acdbb94da5a4687495466f88d66265c732dcdd5 diff --git a/cosmos-sdk-proto/Cargo.toml b/cosmos-sdk-proto/Cargo.toml index 1d1f690c..096a993e 100644 --- a/cosmos-sdk-proto/Cargo.toml +++ b/cosmos-sdk-proto/Cargo.toml @@ -16,18 +16,22 @@ edition = "2021" rust-version = "1.72" [dependencies] +ics23 = "0.11.1" prost = "0.12" -prost-types = "0.12" +prost-wkt-types = "0.5" tendermint-proto = "0.34" # Optional dependencies tonic = { version = "0.10", optional = true, default-features = false, features = ["codegen", "prost"] } +serde = { version = "1.0", optional = true, default-features = false } +informalsystems-pbjson = { version = "0.7.0", optional = true, default-features = false } [features] default = ["grpc-transport"] grpc = ["tonic"] grpc-transport = ["grpc", "tonic/transport"] cosmwasm = [] +serde = ["dep:serde", "dep:informalsystems-pbjson"] [package.metadata.docs.rs] all-features = true diff --git a/cosmos-sdk-proto/src/lib.rs b/cosmos-sdk-proto/src/lib.rs index 53246eaa..7c323774 100644 --- a/cosmos-sdk-proto/src/lib.rs +++ b/cosmos-sdk-proto/src/lib.rs @@ -11,13 +11,25 @@ #![forbid(unsafe_code)] #![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)] +// Needeed for code generated by pbjson-build. +extern crate alloc; + pub mod traits; mod type_names; pub use prost; -pub use prost_types::{Any, Timestamp}; +pub use prost_wkt_types::{Any, Duration, Timestamp}; pub use tendermint_proto as tendermint; +macro_rules! include_proto { + ($path:literal) => { + include!(concat!($path, ".rs")); + + #[cfg(feature = "serde")] + include!(concat!($path, ".serde.rs")); + }; +} + /// The version (commit hash) of the Cosmos SDK used when generating this library. pub const COSMOS_SDK_VERSION: &str = include_str!("prost/cosmos-sdk/COSMOS_SDK_COMMIT"); @@ -26,21 +38,21 @@ pub mod cosmos { /// Authentication of accounts and transactions. pub mod auth { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.auth.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.auth.v1beta1"); } } /// Granting of arbitrary privileges from one account to another. pub mod authz { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.authz.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.authz.v1beta1"); } } /// Balances. pub mod bank { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.bank.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.bank.v1beta1"); } } @@ -52,56 +64,56 @@ pub mod cosmos { /// (the blockchain), and the state machine (the application). pub mod abci { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.abci.v1beta1"); } } /// Key-value pairs. pub mod kv { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.kv.v1beta1"); } } /// Query support. pub mod query { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.query.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.query.v1beta1"); } } /// Reflection support. pub mod reflection { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.reflection.v1beta1"); } pub mod v2alpha1 { - include!("prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.reflection.v2alpha1"); } } /// Snapshots containing Tendermint state sync info. pub mod snapshots { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.snapshots.v1beta1"); } } /// Data structure that holds the state of the application. pub mod store { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.store.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.store.v1beta1"); } } pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.v1beta1"); } pub mod tendermint { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.base.tendermint.v1beta1"); } } } @@ -109,7 +121,7 @@ pub mod cosmos { /// Crisis handling pub mod crisis { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.crisis.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.crisis.v1beta1"); } } @@ -117,85 +129,85 @@ pub mod cosmos { pub mod crypto { /// Multi-signature support. pub mod multisig { - include!("prost/cosmos-sdk/cosmos.crypto.multisig.rs"); + include_proto!("prost/cosmos-sdk/cosmos.crypto.multisig"); pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1"); } } pub mod ed25519 { - include!("prost/cosmos-sdk/cosmos.crypto.ed25519.rs"); + include_proto!("prost/cosmos-sdk/cosmos.crypto.ed25519"); } pub mod secp256k1 { - include!("prost/cosmos-sdk/cosmos.crypto.secp256k1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.crypto.secp256k1"); } pub mod secp256r1 { - include!("prost/cosmos-sdk/cosmos.crypto.secp256r1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.crypto.secp256r1"); } } /// Messages and services handling token distribution pub mod distribution { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.distribution.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.distribution.v1beta1"); } } /// Messages and services handling evidence pub mod evidence { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.evidence.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.evidence.v1beta1"); } } /// Allows accounts to grant fee allowances and to use fees from their accounts. pub mod feegrant { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.feegrant.v1beta1"); } } /// Messages and services handling gentx's pub mod genutil { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.genutil.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.genutil.v1beta1"); } } /// Messages and services handling governance pub mod gov { pub mod v1 { - include!("prost/cosmos-sdk/cosmos.gov.v1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.gov.v1"); } pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.gov.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.gov.v1beta1"); } } /// Messages and services handling minting pub mod mint { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.mint.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.mint.v1beta1"); } } /// Messages and services handling chain parameters pub mod params { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.params.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.params.v1beta1"); } } /// Handling slashing parameters and unjailing pub mod slashing { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.slashing.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.slashing.v1beta1"); } } /// Proof-of-Stake layer for public blockchains. pub mod staking { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.staking.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.staking.v1beta1"); } } @@ -204,26 +216,33 @@ pub mod cosmos { /// Transaction signing support. pub mod signing { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.tx.signing.v1beta1"); } } pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.tx.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.tx.v1beta1"); } } /// Services for the upgrade module. pub mod upgrade { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.upgrade.v1beta1"); } } /// Services and tx's for the vesting module. pub mod vesting { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.vesting.v1beta1.rs"); + include_proto!("prost/cosmos-sdk/cosmos.vesting.v1beta1"); + } + } + + /// ICS23 definitions, re-exportred from the `ics23` crate. + pub mod ics23 { + pub mod v1 { + pub use ics23::*; } } } @@ -234,109 +253,7 @@ pub mod cosmwasm { /// Messages and services handling CosmWasm. pub mod wasm { pub mod v1 { - include!("prost/wasmd/cosmwasm.wasm.v1.rs"); - } - } -} - -/// IBC protobuf definitions. -pub mod ibc { - /// IBC applications. - pub mod applications { - /// Interchain accounts support. - pub mod interchain_accounts { - pub mod controller { - pub mod v1 { - include!("prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs"); - } - } - - pub mod host { - pub mod v1 { - include!("prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs"); - } - } - - pub mod v1 { - include!("prost/ibc-go/ibc.applications.interchain_accounts.v1.rs"); - } - } - - /// Transfer support. - pub mod transfer { - pub mod v1 { - include!("prost/ibc-go/ibc.applications.transfer.v1.rs"); - } - - pub mod v2 { - include!("prost/ibc-go/ibc.applications.transfer.v2.rs"); - } + include_proto!("prost/wasmd/cosmwasm.wasm.v1"); } } - - /// IBC core. - pub mod core { - /// IBC channels. - pub mod channel { - pub mod v1 { - include!("prost/ibc-go/ibc.core.channel.v1.rs"); - } - } - - /// IBC client. - pub mod client { - pub mod v1 { - include!("prost/ibc-go/ibc.core.client.v1.rs"); - } - } - - /// IBC commitments. - pub mod commitment { - pub mod v1 { - include!("prost/ibc-go/ibc.core.commitment.v1.rs"); - } - } - - /// IBC connections. - pub mod connection { - pub mod v1 { - include!("prost/ibc-go/ibc.core.connection.v1.rs"); - } - } - - /// IBC types. - pub mod types { - pub mod v1 { - include!("prost/ibc-go/ibc.core.types.v1.rs"); - } - } - } - - /// IBC light clients. - pub mod lightclients { - pub mod localhost { - pub mod v1 { - include!("prost/ibc-go/ibc.lightclients.localhost.v1.rs"); - } - } - pub mod solomachine { - pub mod v1 { - include!("prost/ibc-go/ibc.lightclients.solomachine.v1.rs"); - } - - pub mod v2 { - include!("prost/ibc-go/ibc.lightclients.solomachine.v2.rs"); - } - } - pub mod tendermint { - pub mod v1 { - include!("prost/ibc-go/ibc.lightclients.tendermint.v1.rs"); - } - } - } -} - -/// ICS23 protobuf definitions. -pub mod ics23 { - include!("prost/ibc-go/ics23.rs"); } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT index b4555f4e..43402bc7 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT @@ -1 +1 @@ -v0.46.15 \ No newline at end of file +v0.47.0 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/amino.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/amino.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/amino.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs new file mode 100644 index 00000000..ab36ba8c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs @@ -0,0 +1,44 @@ +// @generated +/// Module is the config object for the runtime module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// app_name is the name of the app. + #[prost(string, tag = "1")] + pub app_name: ::prost::alloc::string::String, + /// begin_blockers specifies the module names of begin blockers + /// to call in the order in which they should be called. If this is left empty + /// no begin blocker will be registered. + #[prost(string, repeated, tag = "2")] + pub begin_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// end_blockers specifies the module names of the end blockers + /// to call in the order in which they should be called. If this is left empty + /// no end blocker will be registered. + #[prost(string, repeated, tag = "3")] + pub end_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// init_genesis specifies the module names of init genesis functions + /// to call in the order in which they should be called. If this is left empty + /// no init genesis function will be registered. + #[prost(string, repeated, tag = "4")] + pub init_genesis: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// export_genesis specifies the order in which to export module genesis data. + /// If this is left empty, the init_genesis order will be used for export genesis + /// if it is specified. + #[prost(string, repeated, tag = "5")] + pub export_genesis: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// override_store_keys is an optional list of overrides for the module store keys + /// to be used in keeper construction. + #[prost(message, repeated, tag = "6")] + pub override_store_keys: ::prost::alloc::vec::Vec, +} +/// StoreKeyConfig may be supplied to override the default module store key, which +/// is the module name. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StoreKeyConfig { + /// name of the module to override the store key of + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, + /// the kv store key to use instead of the module name. + #[prost(string, tag = "2")] + pub kv_store_key: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs new file mode 100644 index 00000000..528d74ab --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs @@ -0,0 +1,292 @@ +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; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.app.runtime.v1alpha1.Module", len)?; + if true { + struct_ser.serialize_field("appName", &self.app_name)?; + } + if true { + struct_ser.serialize_field("beginBlockers", &self.begin_blockers)?; + } + if true { + struct_ser.serialize_field("endBlockers", &self.end_blockers)?; + } + if true { + struct_ser.serialize_field("initGenesis", &self.init_genesis)?; + } + if true { + struct_ser.serialize_field("exportGenesis", &self.export_genesis)?; + } + if true { + struct_ser.serialize_field("overrideStoreKeys", &self.override_store_keys)?; + } + 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] = &[ + "app_name", + "appName", + "begin_blockers", + "beginBlockers", + "end_blockers", + "endBlockers", + "init_genesis", + "initGenesis", + "export_genesis", + "exportGenesis", + "override_store_keys", + "overrideStoreKeys", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AppName, + BeginBlockers, + EndBlockers, + InitGenesis, + ExportGenesis, + OverrideStoreKeys, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "appName" | "app_name" => Ok(GeneratedField::AppName), + "beginBlockers" | "begin_blockers" => Ok(GeneratedField::BeginBlockers), + "endBlockers" | "end_blockers" => Ok(GeneratedField::EndBlockers), + "initGenesis" | "init_genesis" => Ok(GeneratedField::InitGenesis), + "exportGenesis" | "export_genesis" => Ok(GeneratedField::ExportGenesis), + "overrideStoreKeys" | "override_store_keys" => Ok(GeneratedField::OverrideStoreKeys), + _ => 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.app.runtime.v1alpha1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut app_name__ = None; + let mut begin_blockers__ = None; + let mut end_blockers__ = None; + let mut init_genesis__ = None; + let mut export_genesis__ = None; + let mut override_store_keys__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AppName => { + if app_name__.is_some() { + return Err(serde::de::Error::duplicate_field("appName")); + } + app_name__ = Some(map_.next_value()?); + } + GeneratedField::BeginBlockers => { + if begin_blockers__.is_some() { + return Err(serde::de::Error::duplicate_field("beginBlockers")); + } + begin_blockers__ = Some(map_.next_value()?); + } + GeneratedField::EndBlockers => { + if end_blockers__.is_some() { + return Err(serde::de::Error::duplicate_field("endBlockers")); + } + end_blockers__ = Some(map_.next_value()?); + } + GeneratedField::InitGenesis => { + if init_genesis__.is_some() { + return Err(serde::de::Error::duplicate_field("initGenesis")); + } + init_genesis__ = Some(map_.next_value()?); + } + GeneratedField::ExportGenesis => { + if export_genesis__.is_some() { + return Err(serde::de::Error::duplicate_field("exportGenesis")); + } + export_genesis__ = Some(map_.next_value()?); + } + GeneratedField::OverrideStoreKeys => { + if override_store_keys__.is_some() { + return Err(serde::de::Error::duplicate_field("overrideStoreKeys")); + } + override_store_keys__ = Some(map_.next_value()?); + } + } + } + Ok(Module { + app_name: app_name__.unwrap_or_default(), + begin_blockers: begin_blockers__.unwrap_or_default(), + end_blockers: end_blockers__.unwrap_or_default(), + init_genesis: init_genesis__.unwrap_or_default(), + export_genesis: export_genesis__.unwrap_or_default(), + override_store_keys: override_store_keys__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.app.runtime.v1alpha1.Module", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StoreKeyConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.runtime.v1alpha1.StoreKeyConfig", len)?; + if true { + struct_ser.serialize_field("moduleName", &self.module_name)?; + } + if true { + struct_ser.serialize_field("kvStoreKey", &self.kv_store_key)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StoreKeyConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module_name", + "moduleName", + "kv_store_key", + "kvStoreKey", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleName, + KvStoreKey, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "kvStoreKey" | "kv_store_key" => Ok(GeneratedField::KvStoreKey), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StoreKeyConfig; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.app.runtime.v1alpha1.StoreKeyConfig") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module_name__ = None; + let mut kv_store_key__ = 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::KvStoreKey => { + if kv_store_key__.is_some() { + return Err(serde::de::Error::duplicate_field("kvStoreKey")); + } + kv_store_key__ = Some(map_.next_value()?); + } + } + } + Ok(StoreKeyConfig { + module_name: module_name__.unwrap_or_default(), + kv_store_key: kv_store_key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.app.runtime.v1alpha1.StoreKeyConfig", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs index e857bec1..203bfcf2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs @@ -88,6 +88,11 @@ pub struct Config { /// modules are the module configurations for the app. #[prost(message, repeated, tag = "1")] pub modules: ::prost::alloc::vec::Vec, + /// golang_bindings specifies explicit interface to implementation type bindings which + /// depinject uses to resolve interface inputs to provider functions. The scope of this + /// field's configuration is global (not module specific). + #[prost(message, repeated, tag = "2")] + pub golang_bindings: ::prost::alloc::vec::Vec, } /// ModuleConfig is a module configuration for an app. #[derive(Clone, PartialEq, ::prost::Message)] @@ -107,7 +112,22 @@ pub struct ModuleConfig { /// config is the config object for the module. Module config messages should /// define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. #[prost(message, optional, tag = "2")] - pub config: ::core::option::Option<::prost_types::Any>, + pub config: ::core::option::Option<::prost_wkt_types::Any>, + /// golang_bindings specifies explicit interface to implementation type bindings which + /// depinject uses to resolve interface inputs to provider functions. The scope of this + /// field's configuration is module specific. + #[prost(message, repeated, tag = "3")] + pub golang_bindings: ::prost::alloc::vec::Vec, +} +/// GolangBinding is an explicit interface type to implementing type binding for dependency injection. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GolangBinding { + /// interface_type is the interface type which will be bound to a specific implementation type + #[prost(string, tag = "1")] + pub interface_type: ::prost::alloc::string::String, + /// implementation is the implementing type which will be supplied when an input of type interface is requested + #[prost(string, tag = "2")] + pub implementation: ::prost::alloc::string::String, } /// QueryConfigRequest is the Query/Config request type. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.serde.rs new file mode 100644 index 00000000..c5156195 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.serde.rs @@ -0,0 +1,835 @@ +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.app.v1alpha1.Config", len)?; + if true { + struct_ser.serialize_field("modules", &self.modules)?; + } + if true { + struct_ser.serialize_field("golangBindings", &self.golang_bindings)?; + } + 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] = &[ + "modules", + "golang_bindings", + "golangBindings", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Modules, + GolangBindings, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "modules" => Ok(GeneratedField::Modules), + "golangBindings" | "golang_bindings" => Ok(GeneratedField::GolangBindings), + _ => 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.app.v1alpha1.Config") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut modules__ = None; + let mut golang_bindings__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Modules => { + if modules__.is_some() { + return Err(serde::de::Error::duplicate_field("modules")); + } + modules__ = Some(map_.next_value()?); + } + GeneratedField::GolangBindings => { + if golang_bindings__.is_some() { + return Err(serde::de::Error::duplicate_field("golangBindings")); + } + golang_bindings__ = Some(map_.next_value()?); + } + } + } + Ok(Config { + modules: modules__.unwrap_or_default(), + golang_bindings: golang_bindings__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.app.v1alpha1.Config", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GolangBinding { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.GolangBinding", len)?; + if true { + struct_ser.serialize_field("interfaceType", &self.interface_type)?; + } + if true { + struct_ser.serialize_field("implementation", &self.implementation)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GolangBinding { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "interface_type", + "interfaceType", + "implementation", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + InterfaceType, + Implementation, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "interfaceType" | "interface_type" => Ok(GeneratedField::InterfaceType), + "implementation" => Ok(GeneratedField::Implementation), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GolangBinding; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.GolangBinding") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut interface_type__ = None; + let mut implementation__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::InterfaceType => { + if interface_type__.is_some() { + return Err(serde::de::Error::duplicate_field("interfaceType")); + } + interface_type__ = Some(map_.next_value()?); + } + GeneratedField::Implementation => { + if implementation__.is_some() { + return Err(serde::de::Error::duplicate_field("implementation")); + } + implementation__ = Some(map_.next_value()?); + } + } + } + Ok(GolangBinding { + interface_type: interface_type__.unwrap_or_default(), + implementation: implementation__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.app.v1alpha1.GolangBinding", FIELDS, GeneratedVisitor) + } +} +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 ModuleConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.ModuleConfig", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.config.as_ref() { + struct_ser.serialize_field("config", v)?; + } + if true { + struct_ser.serialize_field("golangBindings", &self.golang_bindings)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModuleConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "config", + "golang_bindings", + "golangBindings", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Config, + GolangBindings, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "config" => Ok(GeneratedField::Config), + "golangBindings" | "golang_bindings" => Ok(GeneratedField::GolangBindings), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ModuleConfig; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.ModuleConfig") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut config__ = None; + let mut golang_bindings__ = 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::Config => { + if config__.is_some() { + return Err(serde::de::Error::duplicate_field("config")); + } + config__ = map_.next_value()?; + } + GeneratedField::GolangBindings => { + if golang_bindings__.is_some() { + return Err(serde::de::Error::duplicate_field("golangBindings")); + } + golang_bindings__ = Some(map_.next_value()?); + } + } + } + Ok(ModuleConfig { + name: name__.unwrap_or_default(), + config: config__, + golang_bindings: golang_bindings__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.app.v1alpha1.ModuleConfig", 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) + } +} +impl serde::Serialize for QueryConfigRequest { + #[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.app.v1alpha1.QueryConfigRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConfigRequest { + #[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 = QueryConfigRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.QueryConfigRequest") + } + + 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(QueryConfigRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.app.v1alpha1.QueryConfigRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConfigResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.QueryConfigResponse", len)?; + if let Some(v) = self.config.as_ref() { + struct_ser.serialize_field("config", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConfigResponse { + #[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 = QueryConfigResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.QueryConfigResponse") + } + + 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(QueryConfigResponse { + config: config__, + }) + } + } + deserializer.deserialize_struct("cosmos.app.v1alpha1.QueryConfigResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.rs new file mode 100644 index 00000000..ca4d7b52 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.rs @@ -0,0 +1,26 @@ +// @generated +/// Module is the config object for the auth module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// bech32_prefix is the bech32 account prefix for the app. + #[prost(string, tag = "1")] + pub bech32_prefix: ::prost::alloc::string::String, + /// module_account_permissions are module account permissions. + #[prost(message, repeated, tag = "2")] + pub module_account_permissions: ::prost::alloc::vec::Vec, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "3")] + pub authority: ::prost::alloc::string::String, +} +/// ModuleAccountPermission represents permissions for a module account. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleAccountPermission { + /// account is the name of the module. + #[prost(string, tag = "1")] + pub account: ::prost::alloc::string::String, + /// permissions are the permissions this module has. Currently recognized + /// values are minter, burner and staking. + #[prost(string, repeated, tag = "2")] + pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.serde.rs new file mode 100644 index 00000000..72f892f8 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs index e14153ef..31ccb996 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs @@ -7,7 +7,7 @@ pub struct BaseAccount { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::prost_types::Any>, + pub pub_key: ::core::option::Option<::prost_wkt_types::Any>, #[prost(uint64, tag = "3")] pub account_number: u64, #[prost(uint64, tag = "4")] @@ -23,6 +23,19 @@ pub struct ModuleAccount { #[prost(string, repeated, tag = "3")] pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleCredential { + /// module_name is the name of the module used for address derivation (passed into address.Module). + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, + /// derivation_keys is for deriving a module account address (passed into address.Module) + /// adding more keys creates sub-account addresses (passed into address.Derive) + #[prost(bytes = "vec", repeated, tag = "2")] + pub derivation_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} /// Params defines the parameters for the auth module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -40,12 +53,12 @@ pub struct Params { /// GenesisState defines the auth module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { - /// params defines all the paramaters of the module. + /// params defines all the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// accounts are the accounts present at genesis. #[prost(message, repeated, tag = "2")] - pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub accounts: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// QueryAccountsRequest is the request type for the Query/Accounts RPC method. /// @@ -63,7 +76,7 @@ pub struct QueryAccountsRequest { pub struct QueryAccountsResponse { /// accounts are the existing accounts #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub accounts: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, @@ -80,7 +93,7 @@ pub struct QueryAccountRequest { pub struct QueryAccountResponse { /// account defines the account of the corresponding address. #[prost(message, optional, tag = "1")] - pub account: ::core::option::Option<::prost_types::Any>, + pub account: ::core::option::Option<::prost_wkt_types::Any>, } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -103,7 +116,7 @@ pub struct QueryModuleAccountsRequest {} #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsResponse { #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub accounts: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -115,7 +128,7 @@ pub struct QueryModuleAccountByNameRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountByNameResponse { #[prost(message, optional, tag = "1")] - pub account: ::core::option::Option<::prost_types::Any>, + pub account: ::core::option::Option<::prost_wkt_types::Any>, } /// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. /// @@ -167,11 +180,19 @@ pub struct AddressStringToBytesResponse { /// Since: cosmos-sdk 0.46.2 #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdRequest { + /// Deprecated, use account_id instead + /// /// id is the account number of the address to be queried. This field /// should have been an uint64 (like all account numbers), and will be /// updated to uint64 in a future version of the auth query. + #[deprecated] #[prost(int64, tag = "1")] pub id: i64, + /// account_id is the account number of the address to be queried. + /// + /// Since: cosmos-sdk 0.47 + #[prost(uint64, tag = "2")] + pub account_id: u64, } /// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method /// @@ -181,5 +202,43 @@ pub struct QueryAccountAddressByIdResponse { #[prost(string, tag = "1")] pub account_address: ::prost::alloc::string::String, } +/// QueryAccountInfoRequest is the Query/AccountInfo request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountInfoRequest { + /// address is the account address string. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryAccountInfoResponse is the Query/AccountInfo response type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountInfoResponse { + /// info is the account info which is represented by BaseAccount. + #[prost(message, optional, tag = "1")] + pub info: ::core::option::Option, +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/auth parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("cosmos.auth.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.serde.rs new file mode 100644 index 00000000..2a8f69cb --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.serde.rs @@ -0,0 +1,2668 @@ +impl serde::Serialize for AddressBytesToStringRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressBytesToStringRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("addressBytes", pbjson::private::base64::encode(&self.address_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AddressBytesToStringRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address_bytes", + "addressBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "addressBytes" | "address_bytes" => Ok(GeneratedField::AddressBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AddressBytesToStringRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressBytesToStringRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address_bytes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AddressBytes => { + if address_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("addressBytes")); + } + address_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(AddressBytesToStringRequest { + address_bytes: address_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressBytesToStringRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AddressBytesToStringResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressBytesToStringResponse", len)?; + if true { + struct_ser.serialize_field("addressString", &self.address_string)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AddressBytesToStringResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address_string", + "addressString", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressString, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "addressString" | "address_string" => Ok(GeneratedField::AddressString), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AddressBytesToStringResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressBytesToStringResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address_string__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AddressString => { + if address_string__.is_some() { + return Err(serde::de::Error::duplicate_field("addressString")); + } + address_string__ = Some(map_.next_value()?); + } + } + } + Ok(AddressBytesToStringResponse { + address_string: address_string__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressBytesToStringResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AddressStringToBytesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressStringToBytesRequest", len)?; + if true { + struct_ser.serialize_field("addressString", &self.address_string)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AddressStringToBytesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address_string", + "addressString", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressString, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "addressString" | "address_string" => Ok(GeneratedField::AddressString), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AddressStringToBytesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressStringToBytesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address_string__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AddressString => { + if address_string__.is_some() { + return Err(serde::de::Error::duplicate_field("addressString")); + } + address_string__ = Some(map_.next_value()?); + } + } + } + Ok(AddressStringToBytesRequest { + address_string: address_string__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressStringToBytesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AddressStringToBytesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.AddressStringToBytesResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("addressBytes", pbjson::private::base64::encode(&self.address_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AddressStringToBytesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address_bytes", + "addressBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "addressBytes" | "address_bytes" => Ok(GeneratedField::AddressBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AddressStringToBytesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressStringToBytesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address_bytes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AddressBytes => { + if address_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("addressBytes")); + } + address_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(AddressStringToBytesResponse { + address_bytes: address_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.AddressStringToBytesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for BaseAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.BaseAccount", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pub_key.as_ref() { + struct_ser.serialize_field("pubKey", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("accountNumber", ::alloc::string::ToString::to_string(&self.account_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for BaseAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "pub_key", + "pubKey", + "account_number", + "accountNumber", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + PubKey, + AccountNumber, + Sequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + "pubKey" | "pub_key" => Ok(GeneratedField::PubKey), + "accountNumber" | "account_number" => Ok(GeneratedField::AccountNumber), + "sequence" => Ok(GeneratedField::Sequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BaseAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.BaseAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut pub_key__ = None; + let mut account_number__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + GeneratedField::PubKey => { + if pub_key__.is_some() { + return Err(serde::de::Error::duplicate_field("pubKey")); + } + pub_key__ = map_.next_value()?; + } + GeneratedField::AccountNumber => { + if account_number__.is_some() { + return Err(serde::de::Error::duplicate_field("accountNumber")); + } + account_number__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(BaseAccount { + address: address__.unwrap_or_default(), + pub_key: pub_key__, + account_number: account_number__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.BaseAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Bech32PrefixRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Bech32PrefixRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Bech32PrefixRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Bech32PrefixRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Bech32PrefixRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(Bech32PrefixRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.Bech32PrefixRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Bech32PrefixResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Bech32PrefixResponse", len)?; + if true { + struct_ser.serialize_field("bech32Prefix", &self.bech32_prefix)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Bech32PrefixResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "bech32_prefix", + "bech32Prefix", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bech32Prefix, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "bech32Prefix" | "bech32_prefix" => Ok(GeneratedField::Bech32Prefix), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Bech32PrefixResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Bech32PrefixResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut bech32_prefix__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Bech32Prefix => { + if bech32_prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("bech32Prefix")); + } + bech32_prefix__ = Some(map_.next_value()?); + } + } + } + Ok(Bech32PrefixResponse { + bech32_prefix: bech32_prefix__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.Bech32PrefixResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if true { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params", + "accounts", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + Accounts, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + "accounts" => Ok(GeneratedField::Accounts), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut accounts__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + GeneratedField::Accounts => { + if accounts__.is_some() { + return Err(serde::de::Error::duplicate_field("accounts")); + } + accounts__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + accounts: accounts__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ModuleAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.ModuleAccount", len)?; + if let Some(v) = self.base_account.as_ref() { + struct_ser.serialize_field("baseAccount", v)?; + } + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if true { + struct_ser.serialize_field("permissions", &self.permissions)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModuleAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_account", + "baseAccount", + "name", + "permissions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseAccount, + Name, + Permissions, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "baseAccount" | "base_account" => Ok(GeneratedField::BaseAccount), + "name" => Ok(GeneratedField::Name), + "permissions" => Ok(GeneratedField::Permissions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ModuleAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.ModuleAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_account__ = None; + let mut name__ = None; + let mut permissions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BaseAccount => { + if base_account__.is_some() { + return Err(serde::de::Error::duplicate_field("baseAccount")); + } + base_account__ = map_.next_value()?; + } + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Permissions => { + if permissions__.is_some() { + return Err(serde::de::Error::duplicate_field("permissions")); + } + permissions__ = Some(map_.next_value()?); + } + } + } + Ok(ModuleAccount { + base_account: base_account__, + name: name__.unwrap_or_default(), + permissions: permissions__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.ModuleAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ModuleCredential { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.ModuleCredential", len)?; + if true { + struct_ser.serialize_field("moduleName", &self.module_name)?; + } + if true { + struct_ser.serialize_field("derivationKeys", &self.derivation_keys.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModuleCredential { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module_name", + "moduleName", + "derivation_keys", + "derivationKeys", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleName, + DerivationKeys, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "moduleName" | "module_name" => Ok(GeneratedField::ModuleName), + "derivationKeys" | "derivation_keys" => Ok(GeneratedField::DerivationKeys), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ModuleCredential; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.ModuleCredential") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module_name__ = None; + let mut derivation_keys__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ModuleName => { + if module_name__.is_some() { + return Err(serde::de::Error::duplicate_field("moduleName")); + } + module_name__ = Some(map_.next_value()?); + } + GeneratedField::DerivationKeys => { + if derivation_keys__.is_some() { + return Err(serde::de::Error::duplicate_field("derivationKeys")); + } + derivation_keys__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(ModuleCredential { + module_name: module_name__.unwrap_or_default(), + derivation_keys: derivation_keys__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.ModuleCredential", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authority", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.MsgUpdateParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.MsgUpdateParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Params", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("maxMemoCharacters", ::alloc::string::ToString::to_string(&self.max_memo_characters).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txSigLimit", ::alloc::string::ToString::to_string(&self.tx_sig_limit).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txSizeCostPerByte", ::alloc::string::ToString::to_string(&self.tx_size_cost_per_byte).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sigVerifyCostEd25519", ::alloc::string::ToString::to_string(&self.sig_verify_cost_ed25519).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sigVerifyCostSecp256k1", ::alloc::string::ToString::to_string(&self.sig_verify_cost_secp256k1).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "max_memo_characters", + "maxMemoCharacters", + "tx_sig_limit", + "txSigLimit", + "tx_size_cost_per_byte", + "txSizeCostPerByte", + "sig_verify_cost_ed25519", + "sigVerifyCostEd25519", + "sig_verify_cost_secp256k1", + "sigVerifyCostSecp256k1", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MaxMemoCharacters, + TxSigLimit, + TxSizeCostPerByte, + SigVerifyCostEd25519, + SigVerifyCostSecp256k1, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "maxMemoCharacters" | "max_memo_characters" => Ok(GeneratedField::MaxMemoCharacters), + "txSigLimit" | "tx_sig_limit" => Ok(GeneratedField::TxSigLimit), + "txSizeCostPerByte" | "tx_size_cost_per_byte" => Ok(GeneratedField::TxSizeCostPerByte), + "sigVerifyCostEd25519" | "sig_verify_cost_ed25519" => Ok(GeneratedField::SigVerifyCostEd25519), + "sigVerifyCostSecp256k1" | "sig_verify_cost_secp256k1" => Ok(GeneratedField::SigVerifyCostSecp256k1), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Params; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut max_memo_characters__ = None; + let mut tx_sig_limit__ = None; + let mut tx_size_cost_per_byte__ = None; + let mut sig_verify_cost_ed25519__ = None; + let mut sig_verify_cost_secp256k1__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MaxMemoCharacters => { + if max_memo_characters__.is_some() { + return Err(serde::de::Error::duplicate_field("maxMemoCharacters")); + } + max_memo_characters__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TxSigLimit => { + if tx_sig_limit__.is_some() { + return Err(serde::de::Error::duplicate_field("txSigLimit")); + } + tx_sig_limit__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TxSizeCostPerByte => { + if tx_size_cost_per_byte__.is_some() { + return Err(serde::de::Error::duplicate_field("txSizeCostPerByte")); + } + tx_size_cost_per_byte__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::SigVerifyCostEd25519 => { + if sig_verify_cost_ed25519__.is_some() { + return Err(serde::de::Error::duplicate_field("sigVerifyCostEd25519")); + } + sig_verify_cost_ed25519__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::SigVerifyCostSecp256k1 => { + if sig_verify_cost_secp256k1__.is_some() { + return Err(serde::de::Error::duplicate_field("sigVerifyCostSecp256k1")); + } + sig_verify_cost_secp256k1__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Params { + max_memo_characters: max_memo_characters__.unwrap_or_default(), + tx_sig_limit: tx_sig_limit__.unwrap_or_default(), + tx_size_cost_per_byte: tx_size_cost_per_byte__.unwrap_or_default(), + sig_verify_cost_ed25519: sig_verify_cost_ed25519__.unwrap_or_default(), + sig_verify_cost_secp256k1: sig_verify_cost_secp256k1__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountAddressByIdRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("accountId", ::alloc::string::ToString::to_string(&self.account_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountAddressByIdRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "account_id", + "accountId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + AccountId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "id" => Ok(GeneratedField::Id), + "accountId" | "account_id" => Ok(GeneratedField::AccountId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountAddressByIdRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountAddressByIDRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut account_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::AccountId => { + if account_id__.is_some() { + return Err(serde::de::Error::duplicate_field("accountId")); + } + account_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryAccountAddressByIdRequest { + id: id__.unwrap_or_default(), + account_id: account_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountAddressByIdResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", len)?; + if true { + struct_ser.serialize_field("accountAddress", &self.account_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountAddressByIdResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "account_address", + "accountAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AccountAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "accountAddress" | "account_address" => Ok(GeneratedField::AccountAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountAddressByIdResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountAddressByIDResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut account_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AccountAddress => { + if account_address__.is_some() { + return Err(serde::de::Error::duplicate_field("accountAddress")); + } + account_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAccountAddressByIdResponse { + account_address: account_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountInfoRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountInfoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAccountInfoRequest { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountInfoResponse", len)?; + if let Some(v) = self.info.as_ref() { + struct_ser.serialize_field("info", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "info", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Info, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "info" => Ok(GeneratedField::Info), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut info__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Info => { + if info__.is_some() { + return Err(serde::de::Error::duplicate_field("info")); + } + info__ = map_.next_value()?; + } + } + } + Ok(QueryAccountInfoResponse { + info: info__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAccountRequest { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountResponse", len)?; + if let Some(v) = self.account.as_ref() { + struct_ser.serialize_field("account", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "account", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Account, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "account" => Ok(GeneratedField::Account), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut account__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Account => { + if account__.is_some() { + return Err(serde::de::Error::duplicate_field("account")); + } + account__ = map_.next_value()?; + } + } + } + Ok(QueryAccountResponse { + account: account__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAccountsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAccountsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountsResponse", len)?; + if true { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAccountsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "accounts", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Accounts, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "accounts" => Ok(GeneratedField::Accounts), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut accounts__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Accounts => { + if accounts__.is_some() { + return Err(serde::de::Error::duplicate_field("accounts")); + } + accounts__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAccountsResponse { + accounts: accounts__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryAccountsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryModuleAccountByNameRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryModuleAccountByNameRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryModuleAccountByNameRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountByNameRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + } + } + Ok(QueryModuleAccountByNameRequest { + name: name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryModuleAccountByNameResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", len)?; + if let Some(v) = self.account.as_ref() { + struct_ser.serialize_field("account", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryModuleAccountByNameResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "account", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Account, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "account" => Ok(GeneratedField::Account), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryModuleAccountByNameResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountByNameResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut account__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Account => { + if account__.is_some() { + return Err(serde::de::Error::duplicate_field("account")); + } + account__ = map_.next_value()?; + } + } + } + Ok(QueryModuleAccountByNameResponse { + account: account__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryModuleAccountsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryModuleAccountsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryModuleAccountsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryModuleAccountsRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryModuleAccountsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsResponse", len)?; + if true { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryModuleAccountsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "accounts", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Accounts, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "accounts" => Ok(GeneratedField::Accounts), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryModuleAccountsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut accounts__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Accounts => { + if accounts__.is_some() { + return Err(serde::de::Error::duplicate_field("accounts")); + } + accounts__ = Some(map_.next_value()?); + } + } + } + Ok(QueryModuleAccountsResponse { + accounts: accounts__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(QueryParamsResponse { + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.auth.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs index a11b2e8d..b2d81c51 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs @@ -271,6 +271,25 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn account_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/AccountInfo"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.auth.v1beta1.Query", "AccountInfo")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -323,6 +342,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn account_info( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -756,6 +779,44 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.auth.v1beta1.Query/AccountInfo" => { + #[allow(non_camel_case_types)] + struct AccountInfoSvc(pub Arc); + impl tonic::server::UnaryService for AccountInfoSvc { + type Response = super::QueryAccountInfoResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).account_info(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) @@ -793,3 +854,271 @@ pub mod query_server { const NAME: &'static str = "cosmos.auth.v1beta1.Query"; } } +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.auth.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.auth.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.auth.v1beta1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.module.v1.rs similarity index 61% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.module.v1.rs index c37f344f..af054ea5 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.module.v1.rs @@ -1,5 +1,5 @@ // @generated -/// Module is the module config object for the cosmos.app v1 app module. +/// Module is the config object of the authz module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.module.v1.serde.rs new file mode 100644 index 00000000..639c5046 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.authz.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.authz.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs index 8d38d9f9..70f17cb3 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs @@ -12,12 +12,12 @@ pub struct GenericAuthorization { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Grant { #[prost(message, optional, tag = "1")] - pub authorization: ::core::option::Option<::prost_types::Any>, + pub authorization: ::core::option::Option<::prost_wkt_types::Any>, /// time when the grant will expire and will be pruned. If null, then the grant /// doesn't have a time expiration (other conditions in `authorization` /// may apply to invalidate the grant) #[prost(message, optional, tag = "2")] - pub expiration: ::core::option::Option<::prost_types::Timestamp>, + pub expiration: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// GrantAuthorization extends a grant with both the addresses of the grantee and granter. /// It is used in genesis.proto and query.proto @@ -28,9 +28,9 @@ pub struct GrantAuthorization { #[prost(string, tag = "2")] pub grantee: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] - pub authorization: ::core::option::Option<::prost_types::Any>, + pub authorization: ::core::option::Option<::prost_wkt_types::Any>, #[prost(message, optional, tag = "4")] - pub expiration: ::core::option::Option<::prost_types::Timestamp>, + pub expiration: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// GrantQueueItem contains the list of TypeURL of a sdk.Msg. #[derive(Clone, PartialEq, ::prost::Message)] @@ -157,11 +157,11 @@ pub struct MsgExecResponse { pub struct MsgExec { #[prost(string, tag = "1")] pub grantee: ::prost::alloc::string::String, - /// Authorization Msg requests to execute. Each msg must implement Authorization interface + /// Execute Msg. /// The x/authz will try to find a grant matching (msg.signers\[0\], grantee, MsgTypeURL(msg)) /// triple and validate it. #[prost(message, repeated, tag = "2")] - pub msgs: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub msgs: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// MsgGrantResponse defines the Msg/MsgGrant response type. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.serde.rs new file mode 100644 index 00000000..8b611de5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.serde.rs @@ -0,0 +1,2054 @@ +impl serde::Serialize for EventGrant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.authz.v1beta1.EventGrant", len)?; + if true { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventGrant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "msg_type_url", + "msgTypeUrl", + "granter", + "grantee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgTypeUrl, + Granter, + Grantee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventGrant; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.EventGrant") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut msg_type_url__ = None; + let mut granter__ = None; + let mut grantee__ = 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()?); + } + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + } + } + Ok(EventGrant { + msg_type_url: msg_type_url__.unwrap_or_default(), + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.EventGrant", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventRevoke { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.authz.v1beta1.EventRevoke", len)?; + if true { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventRevoke { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "msg_type_url", + "msgTypeUrl", + "granter", + "grantee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgTypeUrl, + Granter, + Grantee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventRevoke; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.EventRevoke") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut msg_type_url__ = None; + let mut granter__ = None; + let mut grantee__ = 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()?); + } + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + } + } + Ok(EventRevoke { + msg_type_url: msg_type_url__.unwrap_or_default(), + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.EventRevoke", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenericAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.GenericAuthorization", len)?; + if true { + struct_ser.serialize_field("msg", &self.msg)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenericAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenericAuthorization; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GenericAuthorization") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut msg__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = Some(map_.next_value()?); + } + } + } + Ok(GenericAuthorization { + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.GenericAuthorization", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.GenesisState", len)?; + if true { + struct_ser.serialize_field("authorization", &self.authorization)?; + } + 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] = &[ + "authorization", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authorization, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authorization" => Ok(GeneratedField::Authorization), + _ => 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.authz.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authorization__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authorization => { + if authorization__.is_some() { + return Err(serde::de::Error::duplicate_field("authorization")); + } + authorization__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + authorization: authorization__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Grant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.Grant", len)?; + if let Some(v) = self.authorization.as_ref() { + struct_ser.serialize_field("authorization", v)?; + } + if let Some(v) = self.expiration.as_ref() { + struct_ser.serialize_field("expiration", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Grant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authorization", + "expiration", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authorization, + Expiration, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authorization" => Ok(GeneratedField::Authorization), + "expiration" => Ok(GeneratedField::Expiration), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Grant; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.Grant") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authorization__ = None; + let mut expiration__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authorization => { + if authorization__.is_some() { + return Err(serde::de::Error::duplicate_field("authorization")); + } + authorization__ = map_.next_value()?; + } + GeneratedField::Expiration => { + if expiration__.is_some() { + return Err(serde::de::Error::duplicate_field("expiration")); + } + expiration__ = map_.next_value()?; + } + } + } + Ok(Grant { + authorization: authorization__, + expiration: expiration__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.Grant", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GrantAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.authz.v1beta1.GrantAuthorization", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.authorization.as_ref() { + struct_ser.serialize_field("authorization", v)?; + } + if let Some(v) = self.expiration.as_ref() { + struct_ser.serialize_field("expiration", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GrantAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + "authorization", + "expiration", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Authorization, + Expiration, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "authorization" => Ok(GeneratedField::Authorization), + "expiration" => Ok(GeneratedField::Expiration), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GrantAuthorization; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GrantAuthorization") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut authorization__ = None; + let mut expiration__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Authorization => { + if authorization__.is_some() { + return Err(serde::de::Error::duplicate_field("authorization")); + } + authorization__ = map_.next_value()?; + } + GeneratedField::Expiration => { + if expiration__.is_some() { + return Err(serde::de::Error::duplicate_field("expiration")); + } + expiration__ = map_.next_value()?; + } + } + } + Ok(GrantAuthorization { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + authorization: authorization__, + expiration: expiration__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.GrantAuthorization", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GrantQueueItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.GrantQueueItem", len)?; + if true { + struct_ser.serialize_field("msgTypeUrls", &self.msg_type_urls)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GrantQueueItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "msg_type_urls", + "msgTypeUrls", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgTypeUrls, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "msgTypeUrls" | "msg_type_urls" => Ok(GeneratedField::MsgTypeUrls), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GrantQueueItem; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GrantQueueItem") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut msg_type_urls__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MsgTypeUrls => { + if msg_type_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("msgTypeUrls")); + } + msg_type_urls__ = Some(map_.next_value()?); + } + } + } + Ok(GrantQueueItem { + msg_type_urls: msg_type_urls__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.GrantQueueItem", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.MsgExec", len)?; + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if true { + struct_ser.serialize_field("msgs", &self.msgs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "grantee", + "msgs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grantee, + 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 { + "grantee" => Ok(GeneratedField::Grantee), + "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 = MsgExec; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgExec") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut grantee__ = None; + let mut msgs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Msgs => { + if msgs__.is_some() { + return Err(serde::de::Error::duplicate_field("msgs")); + } + msgs__ = Some(map_.next_value()?); + } + } + } + Ok(MsgExec { + grantee: grantee__.unwrap_or_default(), + msgs: msgs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.MsgExec", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExecResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.MsgExecResponse", len)?; + if true { + struct_ser.serialize_field("results", &self.results.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExecResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "results", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Results, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "results" => Ok(GeneratedField::Results), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgExecResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgExecResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut results__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Results => { + if results__.is_some() { + return Err(serde::de::Error::duplicate_field("results")); + } + results__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(MsgExecResponse { + results: results__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.MsgExecResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgGrant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.authz.v1beta1.MsgGrant", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.grant.as_ref() { + struct_ser.serialize_field("grant", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgGrant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + "grant", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Grant, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "grant" => Ok(GeneratedField::Grant), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgGrant; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgGrant") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut grant__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Grant => { + if grant__.is_some() { + return Err(serde::de::Error::duplicate_field("grant")); + } + grant__ = map_.next_value()?; + } + } + } + Ok(MsgGrant { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + grant: grant__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.MsgGrant", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgGrantResponse { + #[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.authz.v1beta1.MsgGrantResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgGrantResponse { + #[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 = MsgGrantResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgGrantResponse") + } + + 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(MsgGrantResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.MsgGrantResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRevoke { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.authz.v1beta1.MsgRevoke", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if true { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRevoke { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + "msg_type_url", + "msgTypeUrl", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + 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 { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "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 = MsgRevoke; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgRevoke") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut msg_type_url__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::MsgTypeUrl => { + if msg_type_url__.is_some() { + return Err(serde::de::Error::duplicate_field("msgTypeUrl")); + } + msg_type_url__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRevoke { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + msg_type_url: msg_type_url__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.MsgRevoke", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRevokeResponse { + #[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.authz.v1beta1.MsgRevokeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRevokeResponse { + #[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 = MsgRevokeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgRevokeResponse") + } + + 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(MsgRevokeResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.MsgRevokeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGranteeGrantsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranteeGrantsRequest", len)?; + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGranteeGrantsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "grantee", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grantee, + 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 { + "grantee" => Ok(GeneratedField::Grantee), + "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 = QueryGranteeGrantsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranteeGrantsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut grantee__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGranteeGrantsRequest { + grantee: grantee__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.QueryGranteeGrantsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGranteeGrantsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranteeGrantsResponse", len)?; + if true { + struct_ser.serialize_field("grants", &self.grants)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGranteeGrantsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "grants", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grants, + 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 { + "grants" => Ok(GeneratedField::Grants), + "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 = QueryGranteeGrantsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranteeGrantsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut grants__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Grants => { + if grants__.is_some() { + return Err(serde::de::Error::duplicate_field("grants")); + } + grants__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGranteeGrantsResponse { + grants: grants__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.QueryGranteeGrantsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGranterGrantsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranterGrantsRequest", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGranterGrantsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + 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 { + "granter" => Ok(GeneratedField::Granter), + "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 = QueryGranterGrantsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranterGrantsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGranterGrantsRequest { + granter: granter__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.QueryGranterGrantsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGranterGrantsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranterGrantsResponse", len)?; + if true { + struct_ser.serialize_field("grants", &self.grants)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGranterGrantsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "grants", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grants, + 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 { + "grants" => Ok(GeneratedField::Grants), + "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 = QueryGranterGrantsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranterGrantsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut grants__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Grants => { + if grants__.is_some() { + return Err(serde::de::Error::duplicate_field("grants")); + } + grants__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGranterGrantsResponse { + grants: grants__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.QueryGranterGrantsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGrantsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.authz.v1beta1.QueryGrantsRequest", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if true { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGrantsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + "msg_type_url", + "msgTypeUrl", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + MsgTypeUrl, + 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 { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "msgTypeUrl" | "msg_type_url" => Ok(GeneratedField::MsgTypeUrl), + "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 = QueryGrantsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGrantsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut msg_type_url__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::MsgTypeUrl => { + if msg_type_url__.is_some() { + return Err(serde::de::Error::duplicate_field("msgTypeUrl")); + } + msg_type_url__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGrantsRequest { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + msg_type_url: msg_type_url__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.QueryGrantsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGrantsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.QueryGrantsResponse", len)?; + if true { + struct_ser.serialize_field("grants", &self.grants)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGrantsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "grants", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grants, + 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 { + "grants" => Ok(GeneratedField::Grants), + "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 = QueryGrantsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGrantsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut grants__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Grants => { + if grants__.is_some() { + return Err(serde::de::Error::duplicate_field("grants")); + } + grants__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGrantsResponse { + grants: grants__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.authz.v1beta1.QueryGrantsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs new file mode 100644 index 00000000..b7fb2f2e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs @@ -0,0 +1,139 @@ +// @generated +/// ModuleOptions describes the CLI options for a Cosmos SDK module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleOptions { + /// tx describes the tx command for the module. + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, + /// query describes the tx command for the module. + #[prost(message, optional, tag = "2")] + pub query: ::core::option::Option, +} +/// ServiceCommandDescriptor describes a CLI command based on a protobuf service. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ServiceCommandDescriptor { + /// service is the fully qualified name of the protobuf service to build + /// the command from. It can be left empty if sub_commands are used instead + /// which may be the case if a module provides multiple tx and/or query services. + #[prost(string, tag = "1")] + pub service: ::prost::alloc::string::String, + /// rpc_command_options are options for commands generated from rpc methods. + /// If no options are specified for a given rpc method on the service, a + /// command will be generated for that method with the default options. + #[prost(message, repeated, tag = "2")] + pub rpc_command_options: ::prost::alloc::vec::Vec, + /// sub_commands is a map of optional sub-commands for this command based on + /// different protobuf services. The map key is used as the name of the + /// sub-command. + #[prost(map = "string, message", tag = "3")] + pub sub_commands: + ::std::collections::HashMap<::prost::alloc::string::String, ServiceCommandDescriptor>, +} +/// RpcCommandOptions specifies options for commands generated from protobuf +/// rpc methods. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RpcCommandOptions { + /// rpc_method is short name of the protobuf rpc method that this command is + /// generated from. + #[prost(string, tag = "1")] + pub rpc_method: ::prost::alloc::string::String, + /// use is the one-line usage method. It also allows specifying an alternate + /// name for the command as the first word of the usage text. + /// + /// By default the name of an rpc command is the kebab-case short name of the + /// rpc method. + #[prost(string, tag = "2")] + pub r#use: ::prost::alloc::string::String, + /// long is the long message shown in the 'help ' output. + #[prost(string, tag = "3")] + pub long: ::prost::alloc::string::String, + /// short is the short description shown in the 'help' output. + #[prost(string, tag = "4")] + pub short: ::prost::alloc::string::String, + /// example is examples of how to use the command. + #[prost(string, tag = "5")] + pub example: ::prost::alloc::string::String, + /// alias is an array of aliases that can be used instead of the first word in Use. + #[prost(string, repeated, tag = "6")] + pub alias: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// suggest_for is an array of command names for which this command will be suggested - + /// similar to aliases but only suggests. + #[prost(string, repeated, tag = "7")] + pub suggest_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// deprecated defines, if this command is deprecated and should print this string when used. + #[prost(string, tag = "8")] + pub deprecated: ::prost::alloc::string::String, + /// version defines the version for this command. If this value is non-empty and the command does not + /// define a "version" flag, a "version" boolean flag will be added to the command and, if specified, + /// will print content of the "Version" variable. A shorthand "v" flag will also be added if the + /// command does not define one. + #[prost(string, tag = "9")] + pub version: ::prost::alloc::string::String, + /// flag_options are options for flags generated from rpc request fields. + /// By default all request fields are configured as flags. They can + /// also be configured as positional args instead using positional_args. + #[prost(map = "string, message", tag = "10")] + pub flag_options: ::std::collections::HashMap<::prost::alloc::string::String, FlagOptions>, + /// positional_args specifies positional arguments for the command. + #[prost(message, repeated, tag = "11")] + pub positional_args: ::prost::alloc::vec::Vec, + /// skip specifies whether to skip this rpc method when generating commands. + #[prost(bool, tag = "12")] + pub skip: bool, +} +/// FlagOptions are options for flags generated from rpc request fields. +/// By default, all request fields are configured as flags based on the +/// kebab-case name of the field. Fields can be turned into positional arguments +/// instead by using RpcCommandOptions.positional_args. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FlagOptions { + /// name is an alternate name to use for the field flag. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// shorthand is a one-letter abbreviated flag. + #[prost(string, tag = "2")] + pub shorthand: ::prost::alloc::string::String, + /// usage is the help message. + #[prost(string, tag = "3")] + pub usage: ::prost::alloc::string::String, + /// default_value is the default value as text. + #[prost(string, tag = "4")] + pub default_value: ::prost::alloc::string::String, + /// default value is the default value as text if the flag is used without any value. + #[prost(string, tag = "5")] + pub no_opt_default_value: ::prost::alloc::string::String, + /// deprecated is the usage text to show if this flag is deprecated. + #[prost(string, tag = "6")] + pub deprecated: ::prost::alloc::string::String, + /// shorthand_deprecated is the usage text to show if the shorthand of this flag is deprecated. + #[prost(string, tag = "7")] + pub shorthand_deprecated: ::prost::alloc::string::String, + /// hidden hides the flag from help/usage text + #[prost(bool, tag = "8")] + pub hidden: bool, +} +/// PositionalArgDescriptor describes a positional argument. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PositionalArgDescriptor { + /// proto_field specifies the proto field to use as the positional arg. Any + /// fields used as positional args will not have a flag generated. + #[prost(string, tag = "1")] + pub proto_field: ::prost::alloc::string::String, + /// varargs makes a positional parameter a varargs parameter. This can only be + /// applied to last positional parameter and the proto_field must a repeated + /// field. + #[prost(bool, tag = "2")] + pub varargs: bool, +} +/// AppOptionsRequest is the RemoteInfoService/AppOptions request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AppOptionsRequest {} +/// AppOptionsResponse is the RemoteInfoService/AppOptions response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AppOptionsResponse { + /// module_options is a map of module name to autocli module options. + #[prost(map = "string, message", tag = "1")] + pub module_options: ::std::collections::HashMap<::prost::alloc::string::String, ModuleOptions>, +} +include!("cosmos.autocli.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs new file mode 100644 index 00000000..d66ea90d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs @@ -0,0 +1,1008 @@ +impl serde::Serialize for AppOptionsRequest { + #[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.autocli.v1.AppOptionsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AppOptionsRequest { + #[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 = AppOptionsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.AppOptionsRequest") + } + + 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(AppOptionsRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.AppOptionsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AppOptionsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.AppOptionsResponse", len)?; + if true { + struct_ser.serialize_field("moduleOptions", &self.module_options)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AppOptionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module_options", + "moduleOptions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleOptions, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "moduleOptions" | "module_options" => Ok(GeneratedField::ModuleOptions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AppOptionsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.AppOptionsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module_options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ModuleOptions => { + if module_options__.is_some() { + return Err(serde::de::Error::duplicate_field("moduleOptions")); + } + module_options__ = Some( + map_.next_value::>()? + ); + } + } + } + Ok(AppOptionsResponse { + module_options: module_options__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.AppOptionsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FlagOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.autocli.v1.FlagOptions", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if true { + struct_ser.serialize_field("shorthand", &self.shorthand)?; + } + if true { + struct_ser.serialize_field("usage", &self.usage)?; + } + if true { + struct_ser.serialize_field("defaultValue", &self.default_value)?; + } + if true { + struct_ser.serialize_field("noOptDefaultValue", &self.no_opt_default_value)?; + } + if true { + struct_ser.serialize_field("deprecated", &self.deprecated)?; + } + if true { + struct_ser.serialize_field("shorthandDeprecated", &self.shorthand_deprecated)?; + } + if true { + struct_ser.serialize_field("hidden", &self.hidden)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FlagOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "shorthand", + "usage", + "default_value", + "defaultValue", + "no_opt_default_value", + "noOptDefaultValue", + "deprecated", + "shorthand_deprecated", + "shorthandDeprecated", + "hidden", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Shorthand, + Usage, + DefaultValue, + NoOptDefaultValue, + Deprecated, + ShorthandDeprecated, + Hidden, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "shorthand" => Ok(GeneratedField::Shorthand), + "usage" => Ok(GeneratedField::Usage), + "defaultValue" | "default_value" => Ok(GeneratedField::DefaultValue), + "noOptDefaultValue" | "no_opt_default_value" => Ok(GeneratedField::NoOptDefaultValue), + "deprecated" => Ok(GeneratedField::Deprecated), + "shorthandDeprecated" | "shorthand_deprecated" => Ok(GeneratedField::ShorthandDeprecated), + "hidden" => Ok(GeneratedField::Hidden), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FlagOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.FlagOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut shorthand__ = None; + let mut usage__ = None; + let mut default_value__ = None; + let mut no_opt_default_value__ = None; + let mut deprecated__ = None; + let mut shorthand_deprecated__ = None; + let mut hidden__ = 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::Shorthand => { + if shorthand__.is_some() { + return Err(serde::de::Error::duplicate_field("shorthand")); + } + shorthand__ = Some(map_.next_value()?); + } + GeneratedField::Usage => { + if usage__.is_some() { + return Err(serde::de::Error::duplicate_field("usage")); + } + usage__ = Some(map_.next_value()?); + } + GeneratedField::DefaultValue => { + if default_value__.is_some() { + return Err(serde::de::Error::duplicate_field("defaultValue")); + } + default_value__ = Some(map_.next_value()?); + } + GeneratedField::NoOptDefaultValue => { + if no_opt_default_value__.is_some() { + return Err(serde::de::Error::duplicate_field("noOptDefaultValue")); + } + no_opt_default_value__ = Some(map_.next_value()?); + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = Some(map_.next_value()?); + } + GeneratedField::ShorthandDeprecated => { + if shorthand_deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("shorthandDeprecated")); + } + shorthand_deprecated__ = Some(map_.next_value()?); + } + GeneratedField::Hidden => { + if hidden__.is_some() { + return Err(serde::de::Error::duplicate_field("hidden")); + } + hidden__ = Some(map_.next_value()?); + } + } + } + Ok(FlagOptions { + name: name__.unwrap_or_default(), + shorthand: shorthand__.unwrap_or_default(), + usage: usage__.unwrap_or_default(), + default_value: default_value__.unwrap_or_default(), + no_opt_default_value: no_opt_default_value__.unwrap_or_default(), + deprecated: deprecated__.unwrap_or_default(), + shorthand_deprecated: shorthand_deprecated__.unwrap_or_default(), + hidden: hidden__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.FlagOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ModuleOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.ModuleOptions", len)?; + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + if let Some(v) = self.query.as_ref() { + struct_ser.serialize_field("query", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModuleOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx", + "query", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tx, + Query, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "query" => Ok(GeneratedField::Query), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ModuleOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.ModuleOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx__ = None; + let mut query__ = 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()?; + } + GeneratedField::Query => { + if query__.is_some() { + return Err(serde::de::Error::duplicate_field("query")); + } + query__ = map_.next_value()?; + } + } + } + Ok(ModuleOptions { + tx: tx__, + query: query__, + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.ModuleOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PositionalArgDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.PositionalArgDescriptor", len)?; + if true { + struct_ser.serialize_field("protoField", &self.proto_field)?; + } + if true { + struct_ser.serialize_field("varargs", &self.varargs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PositionalArgDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proto_field", + "protoField", + "varargs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProtoField, + Varargs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "protoField" | "proto_field" => Ok(GeneratedField::ProtoField), + "varargs" => Ok(GeneratedField::Varargs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PositionalArgDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.PositionalArgDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proto_field__ = None; + let mut varargs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProtoField => { + if proto_field__.is_some() { + return Err(serde::de::Error::duplicate_field("protoField")); + } + proto_field__ = Some(map_.next_value()?); + } + GeneratedField::Varargs => { + if varargs__.is_some() { + return Err(serde::de::Error::duplicate_field("varargs")); + } + varargs__ = Some(map_.next_value()?); + } + } + } + Ok(PositionalArgDescriptor { + proto_field: proto_field__.unwrap_or_default(), + varargs: varargs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.PositionalArgDescriptor", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RpcCommandOptions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmos.autocli.v1.RpcCommandOptions", len)?; + if true { + struct_ser.serialize_field("rpcMethod", &self.rpc_method)?; + } + if true { + struct_ser.serialize_field("use", &self.r#use)?; + } + if true { + struct_ser.serialize_field("long", &self.long)?; + } + if true { + struct_ser.serialize_field("short", &self.short)?; + } + if true { + struct_ser.serialize_field("example", &self.example)?; + } + if true { + struct_ser.serialize_field("alias", &self.alias)?; + } + if true { + struct_ser.serialize_field("suggestFor", &self.suggest_for)?; + } + if true { + struct_ser.serialize_field("deprecated", &self.deprecated)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + struct_ser.serialize_field("flagOptions", &self.flag_options)?; + } + if true { + struct_ser.serialize_field("positionalArgs", &self.positional_args)?; + } + if true { + struct_ser.serialize_field("skip", &self.skip)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RpcCommandOptions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rpc_method", + "rpcMethod", + "use", + "long", + "short", + "example", + "alias", + "suggest_for", + "suggestFor", + "deprecated", + "version", + "flag_options", + "flagOptions", + "positional_args", + "positionalArgs", + "skip", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RpcMethod, + Use, + Long, + Short, + Example, + Alias, + SuggestFor, + Deprecated, + Version, + FlagOptions, + PositionalArgs, + Skip, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rpcMethod" | "rpc_method" => Ok(GeneratedField::RpcMethod), + "use" => Ok(GeneratedField::Use), + "long" => Ok(GeneratedField::Long), + "short" => Ok(GeneratedField::Short), + "example" => Ok(GeneratedField::Example), + "alias" => Ok(GeneratedField::Alias), + "suggestFor" | "suggest_for" => Ok(GeneratedField::SuggestFor), + "deprecated" => Ok(GeneratedField::Deprecated), + "version" => Ok(GeneratedField::Version), + "flagOptions" | "flag_options" => Ok(GeneratedField::FlagOptions), + "positionalArgs" | "positional_args" => Ok(GeneratedField::PositionalArgs), + "skip" => Ok(GeneratedField::Skip), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RpcCommandOptions; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.RpcCommandOptions") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rpc_method__ = None; + let mut r#use__ = None; + let mut long__ = None; + let mut short__ = None; + let mut example__ = None; + let mut alias__ = None; + let mut suggest_for__ = None; + let mut deprecated__ = None; + let mut version__ = None; + let mut flag_options__ = None; + let mut positional_args__ = None; + let mut skip__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RpcMethod => { + if rpc_method__.is_some() { + return Err(serde::de::Error::duplicate_field("rpcMethod")); + } + rpc_method__ = Some(map_.next_value()?); + } + GeneratedField::Use => { + if r#use__.is_some() { + return Err(serde::de::Error::duplicate_field("use")); + } + r#use__ = Some(map_.next_value()?); + } + GeneratedField::Long => { + if long__.is_some() { + return Err(serde::de::Error::duplicate_field("long")); + } + long__ = Some(map_.next_value()?); + } + GeneratedField::Short => { + if short__.is_some() { + return Err(serde::de::Error::duplicate_field("short")); + } + short__ = Some(map_.next_value()?); + } + GeneratedField::Example => { + if example__.is_some() { + return Err(serde::de::Error::duplicate_field("example")); + } + example__ = Some(map_.next_value()?); + } + GeneratedField::Alias => { + if alias__.is_some() { + return Err(serde::de::Error::duplicate_field("alias")); + } + alias__ = Some(map_.next_value()?); + } + GeneratedField::SuggestFor => { + if suggest_for__.is_some() { + return Err(serde::de::Error::duplicate_field("suggestFor")); + } + suggest_for__ = Some(map_.next_value()?); + } + GeneratedField::Deprecated => { + if deprecated__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecated")); + } + deprecated__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + GeneratedField::FlagOptions => { + if flag_options__.is_some() { + return Err(serde::de::Error::duplicate_field("flagOptions")); + } + flag_options__ = Some( + map_.next_value::>()? + ); + } + GeneratedField::PositionalArgs => { + if positional_args__.is_some() { + return Err(serde::de::Error::duplicate_field("positionalArgs")); + } + positional_args__ = Some(map_.next_value()?); + } + GeneratedField::Skip => { + if skip__.is_some() { + return Err(serde::de::Error::duplicate_field("skip")); + } + skip__ = Some(map_.next_value()?); + } + } + } + Ok(RpcCommandOptions { + rpc_method: rpc_method__.unwrap_or_default(), + r#use: r#use__.unwrap_or_default(), + long: long__.unwrap_or_default(), + short: short__.unwrap_or_default(), + example: example__.unwrap_or_default(), + alias: alias__.unwrap_or_default(), + suggest_for: suggest_for__.unwrap_or_default(), + deprecated: deprecated__.unwrap_or_default(), + version: version__.unwrap_or_default(), + flag_options: flag_options__.unwrap_or_default(), + positional_args: positional_args__.unwrap_or_default(), + skip: skip__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.RpcCommandOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ServiceCommandDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.autocli.v1.ServiceCommandDescriptor", len)?; + if true { + struct_ser.serialize_field("service", &self.service)?; + } + if true { + struct_ser.serialize_field("rpcCommandOptions", &self.rpc_command_options)?; + } + if true { + struct_ser.serialize_field("subCommands", &self.sub_commands)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "service", + "rpc_command_options", + "rpcCommandOptions", + "sub_commands", + "subCommands", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Service, + RpcCommandOptions, + SubCommands, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "service" => Ok(GeneratedField::Service), + "rpcCommandOptions" | "rpc_command_options" => Ok(GeneratedField::RpcCommandOptions), + "subCommands" | "sub_commands" => Ok(GeneratedField::SubCommands), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ServiceCommandDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.autocli.v1.ServiceCommandDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut service__ = None; + let mut rpc_command_options__ = None; + let mut sub_commands__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Service => { + if service__.is_some() { + return Err(serde::de::Error::duplicate_field("service")); + } + service__ = Some(map_.next_value()?); + } + GeneratedField::RpcCommandOptions => { + if rpc_command_options__.is_some() { + return Err(serde::de::Error::duplicate_field("rpcCommandOptions")); + } + rpc_command_options__ = Some(map_.next_value()?); + } + GeneratedField::SubCommands => { + if sub_commands__.is_some() { + return Err(serde::de::Error::duplicate_field("subCommands")); + } + sub_commands__ = Some( + map_.next_value::>()? + ); + } + } + } + Ok(ServiceCommandDescriptor { + service: service__.unwrap_or_default(), + rpc_command_options: rpc_command_options__.unwrap_or_default(), + sub_commands: sub_commands__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.autocli.v1.ServiceCommandDescriptor", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs new file mode 100644 index 00000000..315465f7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs @@ -0,0 +1,271 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn app_options( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.autocli.v1.Query/AppOptions"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.autocli.v1.Query", "AppOptions")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn app_options( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.autocli.v1.Query/AppOptions" => { + #[allow(non_camel_case_types)] + struct AppOptionsSvc(pub Arc); + impl tonic::server::UnaryService for AppOptionsSvc { + type Response = super::AppOptionsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).app_options(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AppOptionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.autocli.v1.Query"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs new file mode 100644 index 00000000..8482a66d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs @@ -0,0 +1,14 @@ +// @generated +/// Module is the config object of the bank module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. + /// If left empty it defaults to the list of account names supplied in the auth module configuration as + /// module_account_permissions + #[prost(string, repeated, tag = "1")] + pub blocked_module_accounts_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.serde.rs new file mode 100644 index 00000000..d9196d61 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs index 4574722a..0160e246 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs @@ -7,10 +7,22 @@ pub struct SendAuthorization { #[prost(message, repeated, tag = "1")] pub spend_limit: ::prost::alloc::vec::Vec, + /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + /// granter. If omitted, any recipient is allowed. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, repeated, tag = "2")] + pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Params defines the parameters for the bank module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { + /// Deprecated: Use of SendEnabled in params is deprecated. + /// For genesis, use the newly added send_enabled field in the genesis object. + /// Storage, lookup, and manipulation of this information is now in the keeper. + /// + /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + #[deprecated] #[prost(message, repeated, tag = "1")] pub send_enabled: ::prost::alloc::vec::Vec, #[prost(bool, tag = "2")] @@ -109,7 +121,7 @@ pub struct Metadata { /// GenesisState defines the bank module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { - /// params defines all the paramaters of the module. + /// params defines all the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// balances is an array containing the balances of all the accounts. @@ -119,9 +131,14 @@ pub struct GenesisState { /// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. #[prost(message, repeated, tag = "3")] pub supply: ::prost::alloc::vec::Vec, - /// denom_metadata defines the metadata of the differents coins. + /// denom_metadata defines the metadata of the different coins. #[prost(message, repeated, tag = "4")] pub denom_metadata: ::prost::alloc::vec::Vec, + /// send_enabled defines the denoms where send is enabled or disabled. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, repeated, tag = "5")] + pub send_enabled: ::prost::alloc::vec::Vec, } /// Balance defines an account address and balance pair used in the bank module's /// genesis state. @@ -198,6 +215,29 @@ pub struct QuerySpendableBalancesResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +/// querying an account's spendable balance for a specific denom. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySpendableBalanceByDenomRequest { + /// address is the address to query balances for. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// denom is the coin denom to query balances for. + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, +} +/// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +/// querying an account's spendable balance for a specific denom. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySpendableBalanceByDenomResponse { + /// balance is the balance of the coin. + #[prost(message, optional, tag = "1")] + pub balance: ::core::option::Option, +} /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -314,6 +354,31 @@ pub struct QueryDenomOwnersResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySendEnabledRequest { + /// denoms is the specific denoms you want look up. Leave empty to get all entries. + #[prost(string, repeated, tag = "1")] + pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines an optional pagination for the request. This field is + /// only read if the denoms field is empty. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} +/// QuerySendEnabledResponse defines the RPC response of a SendEnable query. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySendEnabledResponse { + #[prost(message, repeated, tag = "1")] + pub send_enabled: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. This field is only + /// populated if the denoms field in the request is empty. + #[prost(message, optional, tag = "99")] + pub pagination: ::core::option::Option, +} /// MsgSend represents a message to send coins from one account to another. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { @@ -330,6 +395,8 @@ pub struct MsgSendResponse {} /// MsgMultiSend represents an arbitrary multi-in, multi-out send message. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSend { + /// Inputs, despite being `repeated`, only allows one sender input. This is + /// checked in MsgMultiSend's ValidateBasic. #[prost(message, repeated, tag = "1")] pub inputs: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] @@ -338,5 +405,51 @@ pub struct MsgMultiSend { /// MsgMultiSendResponse defines the Msg/MultiSend response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSendResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/bank parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +/// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +/// +/// Only entries to add/update/delete need to be included. +/// Existing SendEnabled entries that are not included in this +/// message are left unchanged. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetSendEnabled { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// send_enabled is the list of entries to add or update. + #[prost(message, repeated, tag = "2")] + pub send_enabled: ::prost::alloc::vec::Vec, + /// use_default_for is a list of denoms that should use the params.default_send_enabled value. + /// Denoms listed here will have their SendEnabled entries deleted. + /// If a denom is included that doesn't have a SendEnabled entry, + /// it will be ignored. + #[prost(string, repeated, tag = "3")] + pub use_default_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetSendEnabledResponse {} include!("cosmos.bank.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs new file mode 100644 index 00000000..6fc304d4 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs index 2d2705ca..4eb8114a 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs @@ -146,6 +146,30 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn spendable_balance_by_denom( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.bank.v1beta1.Query", + "SpendableBalanceByDenom", + )); + self.inner.unary(req, path, codec).await + } pub async fn total_supply( &mut self, request: impl tonic::IntoRequest, @@ -262,6 +286,25 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomOwners")); self.inner.unary(req, path, codec).await } + pub async fn send_enabled( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/SendEnabled"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "SendEnabled")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -287,6 +330,13 @@ pub mod query_server { tonic::Response, tonic::Status, >; + async fn spendable_balance_by_denom( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn total_supply( &self, request: tonic::Request, @@ -311,6 +361,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn send_enabled( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -504,6 +558,48 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom" => { + #[allow(non_camel_case_types)] + struct SpendableBalanceByDenomSvc(pub Arc); + impl + tonic::server::UnaryService + for SpendableBalanceByDenomSvc + { + type Response = super::QuerySpendableBalanceByDenomResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { (*inner).spendable_balance_by_denom(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SpendableBalanceByDenomSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/cosmos.bank.v1beta1.Query/TotalSupply" => { #[allow(non_camel_case_types)] struct TotalSupplySvc(pub Arc); @@ -736,6 +832,44 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.bank.v1beta1.Query/SendEnabled" => { + #[allow(non_camel_case_types)] + struct SendEnabledSvc(pub Arc); + impl tonic::server::UnaryService for SendEnabledSvc { + type Response = super::QuerySendEnabledResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).send_enabled(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SendEnabledSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) @@ -891,6 +1025,44 @@ pub mod msg_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "MultiSend")); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + pub async fn set_send_enabled( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Msg/SetSendEnabled"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "SetSendEnabled")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -909,6 +1081,14 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn set_send_enabled( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1062,6 +1242,82 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.bank.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.bank.v1beta1.Msg/SetSendEnabled" => { + #[allow(non_camel_case_types)] + struct SetSendEnabledSvc(pub Arc); + impl tonic::server::UnaryService for SetSendEnabledSvc { + type Response = super::MsgSetSendEnabledResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).set_send_enabled(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetSendEnabledSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs index 6f3ec0c9..506b3b38 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs @@ -36,7 +36,7 @@ pub struct TxResponse { pub gas_used: i64, /// The request transaction bytes. #[prost(message, optional, tag = "11")] - pub tx: ::core::option::Option<::prost_types::Any>, + pub tx: ::core::option::Option<::prost_wkt_types::Any>, /// Time of the previous block. For heights > 1, it's the weighted median of /// the timestamps of the valid votes in the block.LastCommit. For height == 1, /// it's genesis time. @@ -112,7 +112,7 @@ pub struct Result { /// /// Since: cosmos-sdk 0.46 #[prost(message, repeated, tag = "4")] - pub msg_responses: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub msg_responses: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// SimulationResponse defines the response generated when a transaction is /// successfully simulated. @@ -144,7 +144,7 @@ pub struct TxMsgData { /// /// Since: cosmos-sdk 0.46 #[prost(message, repeated, tag = "2")] - pub msg_responses: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub msg_responses: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// SearchTxsResult defines a structure for querying txs pageable #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs new file mode 100644 index 00000000..70bca307 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs @@ -0,0 +1,1439 @@ +impl serde::Serialize for AbciMessageLog { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.abci.v1beta1.ABCIMessageLog", len)?; + if true { + struct_ser.serialize_field("msgIndex", &self.msg_index)?; + } + if true { + struct_ser.serialize_field("log", &self.log)?; + } + if true { + struct_ser.serialize_field("events", &self.events)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AbciMessageLog { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "msg_index", + "msgIndex", + "log", + "events", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgIndex, + Log, + Events, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "msgIndex" | "msg_index" => Ok(GeneratedField::MsgIndex), + "log" => Ok(GeneratedField::Log), + "events" => Ok(GeneratedField::Events), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AbciMessageLog; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.ABCIMessageLog") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut msg_index__ = None; + let mut log__ = None; + let mut events__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MsgIndex => { + if msg_index__.is_some() { + return Err(serde::de::Error::duplicate_field("msgIndex")); + } + msg_index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Log => { + if log__.is_some() { + return Err(serde::de::Error::duplicate_field("log")); + } + log__ = Some(map_.next_value()?); + } + GeneratedField::Events => { + if events__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + events__ = Some(map_.next_value()?); + } + } + } + Ok(AbciMessageLog { + msg_index: msg_index__.unwrap_or_default(), + log: log__.unwrap_or_default(), + events: events__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.ABCIMessageLog", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Attribute { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.Attribute", len)?; + if true { + struct_ser.serialize_field("key", &self.key)?; + } + if true { + struct_ser.serialize_field("value", &self.value)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Attribute { + #[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 = Attribute; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.Attribute") + } + + 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()?); + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = Some(map_.next_value()?); + } + } + } + Ok(Attribute { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.Attribute", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GasInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.GasInfo", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasWanted", ::alloc::string::ToString::to_string(&self.gas_wanted).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasUsed", ::alloc::string::ToString::to_string(&self.gas_used).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GasInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "gas_wanted", + "gasWanted", + "gas_used", + "gasUsed", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GasWanted, + GasUsed, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "gasWanted" | "gas_wanted" => Ok(GeneratedField::GasWanted), + "gasUsed" | "gas_used" => Ok(GeneratedField::GasUsed), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GasInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.GasInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut gas_wanted__ = None; + let mut gas_used__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GasWanted => { + if gas_wanted__.is_some() { + return Err(serde::de::Error::duplicate_field("gasWanted")); + } + gas_wanted__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::GasUsed => { + if gas_used__.is_some() { + return Err(serde::de::Error::duplicate_field("gasUsed")); + } + gas_used__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(GasInfo { + gas_wanted: gas_wanted__.unwrap_or_default(), + gas_used: gas_used__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.GasInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.MsgData", len)?; + if true { + struct_ser.serialize_field("msgType", &self.msg_type)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "msg_type", + "msgType", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgType, + 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 { + "msgType" | "msg_type" => Ok(GeneratedField::MsgType), + "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 = MsgData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.MsgData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut msg_type__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MsgType => { + if msg_type__.is_some() { + return Err(serde::de::Error::duplicate_field("msgType")); + } + msg_type__ = 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) + ; + } + } + } + Ok(MsgData { + msg_type: msg_type__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.MsgData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Result { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.Result", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + struct_ser.serialize_field("log", &self.log)?; + } + if true { + struct_ser.serialize_field("events", &self.events)?; + } + if true { + struct_ser.serialize_field("msgResponses", &self.msg_responses)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Result { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + "log", + "events", + "msg_responses", + "msgResponses", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + Log, + Events, + MsgResponses, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + "log" => Ok(GeneratedField::Log), + "events" => Ok(GeneratedField::Events), + "msgResponses" | "msg_responses" => Ok(GeneratedField::MsgResponses), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Result; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.Result") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + let mut log__ = None; + let mut events__ = None; + let mut msg_responses__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Log => { + if log__.is_some() { + return Err(serde::de::Error::duplicate_field("log")); + } + log__ = Some(map_.next_value()?); + } + GeneratedField::Events => { + if events__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + events__ = Some(map_.next_value()?); + } + GeneratedField::MsgResponses => { + if msg_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("msgResponses")); + } + msg_responses__ = Some(map_.next_value()?); + } + } + } + Ok(Result { + data: data__.unwrap_or_default(), + log: log__.unwrap_or_default(), + events: events__.unwrap_or_default(), + msg_responses: msg_responses__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.Result", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SearchTxsResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.SearchTxsResult", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("totalCount", ::alloc::string::ToString::to_string(&self.total_count).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("count", ::alloc::string::ToString::to_string(&self.count).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("pageNumber", ::alloc::string::ToString::to_string(&self.page_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("pageTotal", ::alloc::string::ToString::to_string(&self.page_total).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ::alloc::string::ToString::to_string(&self.limit).as_str())?; + } + if true { + struct_ser.serialize_field("txs", &self.txs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SearchTxsResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "total_count", + "totalCount", + "count", + "page_number", + "pageNumber", + "page_total", + "pageTotal", + "limit", + "txs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TotalCount, + Count, + PageNumber, + PageTotal, + Limit, + Txs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "totalCount" | "total_count" => Ok(GeneratedField::TotalCount), + "count" => Ok(GeneratedField::Count), + "pageNumber" | "page_number" => Ok(GeneratedField::PageNumber), + "pageTotal" | "page_total" => Ok(GeneratedField::PageTotal), + "limit" => Ok(GeneratedField::Limit), + "txs" => Ok(GeneratedField::Txs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SearchTxsResult; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.SearchTxsResult") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut total_count__ = None; + let mut count__ = None; + let mut page_number__ = None; + let mut page_total__ = None; + let mut limit__ = None; + let mut txs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TotalCount => { + if total_count__.is_some() { + return Err(serde::de::Error::duplicate_field("totalCount")); + } + total_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Count => { + if count__.is_some() { + return Err(serde::de::Error::duplicate_field("count")); + } + count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PageNumber => { + if page_number__.is_some() { + return Err(serde::de::Error::duplicate_field("pageNumber")); + } + page_number__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::PageTotal => { + if page_total__.is_some() { + return Err(serde::de::Error::duplicate_field("pageTotal")); + } + page_total__ = + 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::Txs => { + if txs__.is_some() { + return Err(serde::de::Error::duplicate_field("txs")); + } + txs__ = Some(map_.next_value()?); + } + } + } + Ok(SearchTxsResult { + total_count: total_count__.unwrap_or_default(), + count: count__.unwrap_or_default(), + page_number: page_number__.unwrap_or_default(), + page_total: page_total__.unwrap_or_default(), + limit: limit__.unwrap_or_default(), + txs: txs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.SearchTxsResult", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SimulationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.SimulationResponse", len)?; + if let Some(v) = self.gas_info.as_ref() { + struct_ser.serialize_field("gasInfo", v)?; + } + if let Some(v) = self.result.as_ref() { + struct_ser.serialize_field("result", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SimulationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "gas_info", + "gasInfo", + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GasInfo, + 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 { + "gasInfo" | "gas_info" => Ok(GeneratedField::GasInfo), + "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 = SimulationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.SimulationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut gas_info__ = None; + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GasInfo => { + if gas_info__.is_some() { + return Err(serde::de::Error::duplicate_field("gasInfo")); + } + gas_info__ = map_.next_value()?; + } + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = map_.next_value()?; + } + } + } + Ok(SimulationResponse { + gas_info: gas_info__, + result: result__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.SimulationResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StringEvent { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.StringEvent", len)?; + if true { + struct_ser.serialize_field("type", &self.r#type)?; + } + if true { + struct_ser.serialize_field("attributes", &self.attributes)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StringEvent { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "type", + "attributes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Attributes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "attributes" => Ok(GeneratedField::Attributes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StringEvent; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.StringEvent") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut r#type__ = None; + let mut attributes__ = 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()?); + } + GeneratedField::Attributes => { + if attributes__.is_some() { + return Err(serde::de::Error::duplicate_field("attributes")); + } + attributes__ = Some(map_.next_value()?); + } + } + } + Ok(StringEvent { + r#type: r#type__.unwrap_or_default(), + attributes: attributes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.StringEvent", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxMsgData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.abci.v1beta1.TxMsgData", len)?; + if true { + struct_ser.serialize_field("data", &self.data)?; + } + if true { + struct_ser.serialize_field("msgResponses", &self.msg_responses)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxMsgData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + "msg_responses", + "msgResponses", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + MsgResponses, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + "msgResponses" | "msg_responses" => Ok(GeneratedField::MsgResponses), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxMsgData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.TxMsgData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + let mut msg_responses__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = Some(map_.next_value()?); + } + GeneratedField::MsgResponses => { + if msg_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("msgResponses")); + } + msg_responses__ = Some(map_.next_value()?); + } + } + } + Ok(TxMsgData { + data: data__.unwrap_or_default(), + msg_responses: msg_responses__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.TxMsgData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.base.abci.v1beta1.TxResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if true { + struct_ser.serialize_field("txhash", &self.txhash)?; + } + if true { + struct_ser.serialize_field("codespace", &self.codespace)?; + } + if true { + struct_ser.serialize_field("code", &self.code)?; + } + if true { + struct_ser.serialize_field("data", &self.data)?; + } + if true { + struct_ser.serialize_field("rawLog", &self.raw_log)?; + } + if true { + struct_ser.serialize_field("logs", &self.logs)?; + } + if true { + struct_ser.serialize_field("info", &self.info)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasWanted", ::alloc::string::ToString::to_string(&self.gas_wanted).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasUsed", ::alloc::string::ToString::to_string(&self.gas_used).as_str())?; + } + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + if true { + struct_ser.serialize_field("timestamp", &self.timestamp)?; + } + if true { + struct_ser.serialize_field("events", &self.events)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "txhash", + "codespace", + "code", + "data", + "raw_log", + "rawLog", + "logs", + "info", + "gas_wanted", + "gasWanted", + "gas_used", + "gasUsed", + "tx", + "timestamp", + "events", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Txhash, + Codespace, + Code, + Data, + RawLog, + Logs, + Info, + GasWanted, + GasUsed, + Tx, + Timestamp, + Events, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "txhash" => Ok(GeneratedField::Txhash), + "codespace" => Ok(GeneratedField::Codespace), + "code" => Ok(GeneratedField::Code), + "data" => Ok(GeneratedField::Data), + "rawLog" | "raw_log" => Ok(GeneratedField::RawLog), + "logs" => Ok(GeneratedField::Logs), + "info" => Ok(GeneratedField::Info), + "gasWanted" | "gas_wanted" => Ok(GeneratedField::GasWanted), + "gasUsed" | "gas_used" => Ok(GeneratedField::GasUsed), + "tx" => Ok(GeneratedField::Tx), + "timestamp" => Ok(GeneratedField::Timestamp), + "events" => Ok(GeneratedField::Events), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.TxResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut txhash__ = None; + let mut codespace__ = None; + let mut code__ = None; + let mut data__ = None; + let mut raw_log__ = None; + let mut logs__ = None; + let mut info__ = None; + let mut gas_wanted__ = None; + let mut gas_used__ = None; + let mut tx__ = None; + let mut timestamp__ = None; + let mut events__ = 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::Txhash => { + if txhash__.is_some() { + return Err(serde::de::Error::duplicate_field("txhash")); + } + txhash__ = Some(map_.next_value()?); + } + GeneratedField::Codespace => { + if codespace__.is_some() { + return Err(serde::de::Error::duplicate_field("codespace")); + } + codespace__ = Some(map_.next_value()?); + } + GeneratedField::Code => { + if code__.is_some() { + return Err(serde::de::Error::duplicate_field("code")); + } + code__ = + 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()?); + } + GeneratedField::RawLog => { + if raw_log__.is_some() { + return Err(serde::de::Error::duplicate_field("rawLog")); + } + raw_log__ = Some(map_.next_value()?); + } + GeneratedField::Logs => { + if logs__.is_some() { + return Err(serde::de::Error::duplicate_field("logs")); + } + logs__ = Some(map_.next_value()?); + } + GeneratedField::Info => { + if info__.is_some() { + return Err(serde::de::Error::duplicate_field("info")); + } + info__ = Some(map_.next_value()?); + } + GeneratedField::GasWanted => { + if gas_wanted__.is_some() { + return Err(serde::de::Error::duplicate_field("gasWanted")); + } + gas_wanted__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::GasUsed => { + if gas_used__.is_some() { + return Err(serde::de::Error::duplicate_field("gasUsed")); + } + gas_used__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Tx => { + if tx__.is_some() { + return Err(serde::de::Error::duplicate_field("tx")); + } + tx__ = map_.next_value()?; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some(map_.next_value()?); + } + GeneratedField::Events => { + if events__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + events__ = Some(map_.next_value()?); + } + } + } + Ok(TxResponse { + height: height__.unwrap_or_default(), + txhash: txhash__.unwrap_or_default(), + codespace: codespace__.unwrap_or_default(), + code: code__.unwrap_or_default(), + data: data__.unwrap_or_default(), + raw_log: raw_log__.unwrap_or_default(), + logs: logs__.unwrap_or_default(), + info: info__.unwrap_or_default(), + gas_wanted: gas_wanted__.unwrap_or_default(), + gas_used: gas_used__.unwrap_or_default(), + tx: tx__, + timestamp: timestamp__.unwrap_or_default(), + events: events__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.abci.v1beta1.TxResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs new file mode 100644 index 00000000..3e2ed8b5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs @@ -0,0 +1,205 @@ +impl serde::Serialize for Pair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pair", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Pair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Pair; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.kv.v1beta1.Pair") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(Pair { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pair", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Pairs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pairs", len)?; + if true { + struct_ser.serialize_field("pairs", &self.pairs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Pairs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pairs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pairs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "pairs" => Ok(GeneratedField::Pairs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Pairs; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.kv.v1beta1.Pairs") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pairs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pairs => { + if pairs__.is_some() { + return Err(serde::de::Error::duplicate_field("pairs")); + } + pairs__ = Some(map_.next_value()?); + } + } + } + Ok(Pairs { + pairs: pairs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pairs", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs new file mode 100644 index 00000000..24a688cd --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.serde.rs new file mode 100644 index 00000000..b58155f7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,284 @@ +impl serde::Serialize for PageRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.query.v1beta1.PageRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("offset", ::alloc::string::ToString::to_string(&self.offset).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ::alloc::string::ToString::to_string(&self.limit).as_str())?; + } + if true { + struct_ser.serialize_field("countTotal", &self.count_total)?; + } + if true { + struct_ser.serialize_field("reverse", &self.reverse)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PageRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + "offset", + "limit", + "count_total", + "countTotal", + "reverse", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Offset, + Limit, + CountTotal, + Reverse, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + "offset" => Ok(GeneratedField::Offset), + "limit" => Ok(GeneratedField::Limit), + "countTotal" | "count_total" => Ok(GeneratedField::CountTotal), + "reverse" => Ok(GeneratedField::Reverse), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PageRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + let mut offset__ = None; + let mut limit__ = None; + let mut count_total__ = None; + let mut reverse__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Offset => { + if offset__.is_some() { + return Err(serde::de::Error::duplicate_field("offset")); + } + offset__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Limit => { + if limit__.is_some() { + return Err(serde::de::Error::duplicate_field("limit")); + } + limit__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CountTotal => { + if count_total__.is_some() { + return Err(serde::de::Error::duplicate_field("countTotal")); + } + count_total__ = Some(map_.next_value()?); + } + GeneratedField::Reverse => { + if reverse__.is_some() { + return Err(serde::de::Error::duplicate_field("reverse")); + } + reverse__ = Some(map_.next_value()?); + } + } + } + Ok(PageRequest { + key: key__.unwrap_or_default(), + offset: offset__.unwrap_or_default(), + limit: limit__.unwrap_or_default(), + count_total: count_total__.unwrap_or_default(), + reverse: reverse__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.query.v1beta1.PageRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PageResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.query.v1beta1.PageResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextKey", pbjson::private::base64::encode(&self.next_key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ::alloc::string::ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PageResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "next_key", + "nextKey", + "total", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextKey, + Total, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "nextKey" | "next_key" => Ok(GeneratedField::NextKey), + "total" => Ok(GeneratedField::Total), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PageResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut next_key__ = None; + let mut total__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NextKey => { + if next_key__.is_some() { + return Err(serde::de::Error::duplicate_field("nextKey")); + } + next_key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Total => { + if total__.is_some() { + return Err(serde::de::Error::duplicate_field("total")); + } + total__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(PageResponse { + next_key: next_key__.unwrap_or_default(), + total: total__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.query.v1beta1.PageResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.serde.rs new file mode 100644 index 00000000..731bbdf0 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.serde.rs new file mode 100644 index 00000000..9103b97c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs index 8d80a25d..a493fea0 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs @@ -93,6 +93,7 @@ pub struct SnapshotExtensionPayload { /// SnapshotKVItem is an exported Key/Value Pair /// /// Since: cosmos-sdk 0.46 +/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotKvItem { #[prost(bytes = "vec", tag = "1")] @@ -103,6 +104,7 @@ pub struct SnapshotKvItem { /// SnapshotSchema is an exported schema of smt store /// /// Since: cosmos-sdk 0.46 +/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotSchema { #[prost(bytes = "vec", repeated, tag = "1")] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs new file mode 100644 index 00000000..f28fcfed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs @@ -0,0 +1,1082 @@ +impl serde::Serialize for Metadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Metadata", len)?; + if true { + struct_ser.serialize_field("chunkHashes", &self.chunk_hashes.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Metadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "chunk_hashes", + "chunkHashes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChunkHashes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "chunkHashes" | "chunk_hashes" => Ok(GeneratedField::ChunkHashes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Metadata; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.Metadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut chunk_hashes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ChunkHashes => { + if chunk_hashes__.is_some() { + return Err(serde::de::Error::duplicate_field("chunkHashes")); + } + chunk_hashes__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(Metadata { + chunk_hashes: chunk_hashes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.Metadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Snapshot { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if true { + struct_ser.serialize_field("format", &self.format)?; + } + if true { + struct_ser.serialize_field("chunks", &self.chunks)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; + } + if let Some(v) = self.metadata.as_ref() { + struct_ser.serialize_field("metadata", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Snapshot { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "format", + "chunks", + "hash", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Format, + Chunks, + Hash, + Metadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "height" => Ok(GeneratedField::Height), + "format" => Ok(GeneratedField::Format), + "chunks" => Ok(GeneratedField::Chunks), + "hash" => Ok(GeneratedField::Hash), + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Snapshot; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.Snapshot") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut format__ = None; + let mut chunks__ = None; + let mut hash__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Format => { + if format__.is_some() { + return Err(serde::de::Error::duplicate_field("format")); + } + format__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Chunks => { + if chunks__.is_some() { + return Err(serde::de::Error::duplicate_field("chunks")); + } + chunks__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Hash => { + if hash__.is_some() { + return Err(serde::de::Error::duplicate_field("hash")); + } + hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = map_.next_value()?; + } + } + } + Ok(Snapshot { + height: height__.unwrap_or_default(), + format: format__.unwrap_or_default(), + chunks: chunks__.unwrap_or_default(), + hash: hash__.unwrap_or_default(), + metadata: metadata__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotExtensionMeta { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if true { + struct_ser.serialize_field("format", &self.format)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotExtensionMeta { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "format", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Format, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "format" => Ok(GeneratedField::Format), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotExtensionMeta; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut format__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Format => { + if format__.is_some() { + return Err(serde::de::Error::duplicate_field("format")); + } + format__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SnapshotExtensionMeta { + name: name__.unwrap_or_default(), + format: format__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotExtensionPayload { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "payload", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Payload, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "payload" => Ok(GeneratedField::Payload), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotExtensionPayload; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut payload__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Payload => { + if payload__.is_some() { + return Err(serde::de::Error::duplicate_field("payload")); + } + payload__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(SnapshotExtensionPayload { + payload: payload__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotIavlItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + if true { + struct_ser.serialize_field("height", &self.height)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotIavlItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + "value", + "version", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + Version, + Height, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + "value" => Ok(GeneratedField::Value), + "version" => Ok(GeneratedField::Version), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotIavlItem; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + let mut value__ = None; + let mut version__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SnapshotIavlItem { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + version: version__.unwrap_or_default(), + height: height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.item.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", len)?; + if let Some(v) = self.item.as_ref() { + match v { + snapshot_item::Item::Store(v) => { + struct_ser.serialize_field("store", v)?; + } + snapshot_item::Item::Iavl(v) => { + struct_ser.serialize_field("iavl", v)?; + } + snapshot_item::Item::Extension(v) => { + struct_ser.serialize_field("extension", v)?; + } + snapshot_item::Item::ExtensionPayload(v) => { + struct_ser.serialize_field("extensionPayload", v)?; + } + snapshot_item::Item::Kv(v) => { + struct_ser.serialize_field("kv", v)?; + } + snapshot_item::Item::Schema(v) => { + struct_ser.serialize_field("schema", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "store", + "iavl", + "extension", + "extension_payload", + "extensionPayload", + "kv", + "schema", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Store, + Iavl, + Extension, + ExtensionPayload, + Kv, + Schema, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "store" => Ok(GeneratedField::Store), + "iavl" => Ok(GeneratedField::Iavl), + "extension" => Ok(GeneratedField::Extension), + "extensionPayload" | "extension_payload" => Ok(GeneratedField::ExtensionPayload), + "kv" => Ok(GeneratedField::Kv), + "schema" => Ok(GeneratedField::Schema), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotItem; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotItem") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut item__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Store => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("store")); + } + item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Store) +; + } + GeneratedField::Iavl => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("iavl")); + } + item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Iavl) +; + } + GeneratedField::Extension => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("extension")); + } + item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Extension) +; + } + GeneratedField::ExtensionPayload => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("extensionPayload")); + } + item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::ExtensionPayload) +; + } + GeneratedField::Kv => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("kv")); + } + item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Kv) +; + } + GeneratedField::Schema => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("schema")); + } + item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Schema) +; + } + } + } + Ok(SnapshotItem { + item: item__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotKvItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotKvItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotKvItem; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotKVItem") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(SnapshotKvItem { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotSchema { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", len)?; + if true { + struct_ser.serialize_field("keys", &self.keys.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotSchema { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "keys", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Keys, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "keys" => Ok(GeneratedField::Keys), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotSchema; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotSchema") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut keys__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Keys => { + if keys__.is_some() { + return Err(serde::de::Error::duplicate_field("keys")); + } + keys__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(SnapshotSchema { + keys: keys__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SnapshotStoreItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SnapshotStoreItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SnapshotStoreItem; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotStoreItem") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + } + } + Ok(SnapshotStoreItem { + name: name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs index 63f94a6d..aabc6760 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs @@ -17,7 +17,7 @@ pub struct StoreInfo { #[prost(message, optional, tag = "2")] pub commit_id: ::core::option::Option, } -/// CommitID defines the committment information when a specific store is +/// CommitID defines the commitment information when a specific store is /// committed. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitId { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs new file mode 100644 index 00000000..5a91fb11 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs @@ -0,0 +1,774 @@ +impl serde::Serialize for BlockMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata", len)?; + if let Some(v) = self.request_begin_block.as_ref() { + struct_ser.serialize_field("requestBeginBlock", v)?; + } + if let Some(v) = self.response_begin_block.as_ref() { + struct_ser.serialize_field("responseBeginBlock", v)?; + } + if true { + struct_ser.serialize_field("deliverTxs", &self.deliver_txs)?; + } + if let Some(v) = self.request_end_block.as_ref() { + struct_ser.serialize_field("requestEndBlock", v)?; + } + if let Some(v) = self.response_end_block.as_ref() { + struct_ser.serialize_field("responseEndBlock", v)?; + } + if let Some(v) = self.response_commit.as_ref() { + struct_ser.serialize_field("responseCommit", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for BlockMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "request_begin_block", + "requestBeginBlock", + "response_begin_block", + "responseBeginBlock", + "deliver_txs", + "deliverTxs", + "request_end_block", + "requestEndBlock", + "response_end_block", + "responseEndBlock", + "response_commit", + "responseCommit", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RequestBeginBlock, + ResponseBeginBlock, + DeliverTxs, + RequestEndBlock, + ResponseEndBlock, + ResponseCommit, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "requestBeginBlock" | "request_begin_block" => Ok(GeneratedField::RequestBeginBlock), + "responseBeginBlock" | "response_begin_block" => Ok(GeneratedField::ResponseBeginBlock), + "deliverTxs" | "deliver_txs" => Ok(GeneratedField::DeliverTxs), + "requestEndBlock" | "request_end_block" => Ok(GeneratedField::RequestEndBlock), + "responseEndBlock" | "response_end_block" => Ok(GeneratedField::ResponseEndBlock), + "responseCommit" | "response_commit" => Ok(GeneratedField::ResponseCommit), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BlockMetadata; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut request_begin_block__ = None; + let mut response_begin_block__ = None; + let mut deliver_txs__ = None; + let mut request_end_block__ = None; + let mut response_end_block__ = None; + let mut response_commit__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RequestBeginBlock => { + if request_begin_block__.is_some() { + return Err(serde::de::Error::duplicate_field("requestBeginBlock")); + } + request_begin_block__ = map_.next_value()?; + } + GeneratedField::ResponseBeginBlock => { + if response_begin_block__.is_some() { + return Err(serde::de::Error::duplicate_field("responseBeginBlock")); + } + response_begin_block__ = map_.next_value()?; + } + GeneratedField::DeliverTxs => { + if deliver_txs__.is_some() { + return Err(serde::de::Error::duplicate_field("deliverTxs")); + } + deliver_txs__ = Some(map_.next_value()?); + } + GeneratedField::RequestEndBlock => { + if request_end_block__.is_some() { + return Err(serde::de::Error::duplicate_field("requestEndBlock")); + } + request_end_block__ = map_.next_value()?; + } + GeneratedField::ResponseEndBlock => { + if response_end_block__.is_some() { + return Err(serde::de::Error::duplicate_field("responseEndBlock")); + } + response_end_block__ = map_.next_value()?; + } + GeneratedField::ResponseCommit => { + if response_commit__.is_some() { + return Err(serde::de::Error::duplicate_field("responseCommit")); + } + response_commit__ = map_.next_value()?; + } + } + } + Ok(BlockMetadata { + request_begin_block: request_begin_block__, + response_begin_block: response_begin_block__, + deliver_txs: deliver_txs__.unwrap_or_default(), + request_end_block: request_end_block__, + response_end_block: response_end_block__, + response_commit: response_commit__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.store.v1beta1.BlockMetadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for block_metadata::DeliverTx { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", len)?; + if let Some(v) = self.request.as_ref() { + struct_ser.serialize_field("request", v)?; + } + if let Some(v) = self.response.as_ref() { + struct_ser.serialize_field("response", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for block_metadata::DeliverTx { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "request", + "response", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Request, + Response, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "request" => Ok(GeneratedField::Request), + "response" => Ok(GeneratedField::Response), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = block_metadata::DeliverTx; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut request__ = None; + let mut response__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Request => { + if request__.is_some() { + return Err(serde::de::Error::duplicate_field("request")); + } + request__ = map_.next_value()?; + } + GeneratedField::Response => { + if response__.is_some() { + return Err(serde::de::Error::duplicate_field("response")); + } + response__ = map_.next_value()?; + } + } + } + Ok(block_metadata::DeliverTx { + request: request__, + response: response__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CommitId { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.CommitID", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CommitId { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "version", + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + Hash, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "version" => Ok(GeneratedField::Version), + "hash" => Ok(GeneratedField::Hash), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CommitId; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.CommitID") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut version__ = None; + let mut hash__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Hash => { + if hash__.is_some() { + return Err(serde::de::Error::duplicate_field("hash")); + } + hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(CommitId { + version: version__.unwrap_or_default(), + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.store.v1beta1.CommitID", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CommitInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.CommitInfo", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + if true { + struct_ser.serialize_field("storeInfos", &self.store_infos)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + StoreInfos, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => 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; + 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()?); + } + } + } + Ok(CommitInfo { + version: version__.unwrap_or_default(), + store_infos: store_infos__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.store.v1beta1.CommitInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StoreInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.StoreInfo", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.commit_id.as_ref() { + struct_ser.serialize_field("commitId", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StoreInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "commit_id", + "commitId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + CommitId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "commitId" | "commit_id" => Ok(GeneratedField::CommitId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StoreInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.StoreInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut commit_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::CommitId => { + if commit_id__.is_some() { + return Err(serde::de::Error::duplicate_field("commitId")); + } + commit_id__ = map_.next_value()?; + } + } + } + Ok(StoreInfo { + name: name__.unwrap_or_default(), + commit_id: commit_id__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.store.v1beta1.StoreInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StoreKvPair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.StoreKVPair", len)?; + if true { + struct_ser.serialize_field("storeKey", &self.store_key)?; + } + if true { + struct_ser.serialize_field("delete", &self.delete)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StoreKvPair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "store_key", + "storeKey", + "delete", + "key", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + StoreKey, + Delete, + Key, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "storeKey" | "store_key" => Ok(GeneratedField::StoreKey), + "delete" => Ok(GeneratedField::Delete), + "key" => Ok(GeneratedField::Key), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StoreKvPair; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.StoreKVPair") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut store_key__ = None; + let mut delete__ = None; + let mut key__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::StoreKey => { + if store_key__.is_some() { + return Err(serde::de::Error::duplicate_field("storeKey")); + } + store_key__ = Some(map_.next_value()?); + } + GeneratedField::Delete => { + if delete__.is_some() { + return Err(serde::de::Error::duplicate_field("delete")); + } + delete__ = Some(map_.next_value()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(StoreKvPair { + store_key: store_key__.unwrap_or_default(), + delete: delete__.unwrap_or_default(), + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.store.v1beta1.StoreKVPair", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs index e6de1499..856bc4c6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs @@ -23,7 +23,7 @@ pub struct Header { #[prost(int64, tag = "3")] pub height: i64, #[prost(message, optional, tag = "4")] - pub time: ::core::option::Option<::prost_types::Timestamp>, + pub time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// prev block info #[prost(message, optional, tag = "5")] pub last_block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>, @@ -65,8 +65,7 @@ pub struct Header { #[prost(string, tag = "14")] pub proposer_address: ::prost::alloc::string::String, } -/// GetValidatorSetByHeightRequest is the request type for the -/// Query/GetValidatorSetByHeight RPC method. +/// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightRequest { #[prost(int64, tag = "1")] @@ -75,8 +74,7 @@ pub struct GetValidatorSetByHeightRequest { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// GetValidatorSetByHeightResponse is the response type for the -/// Query/GetValidatorSetByHeight RPC method. +/// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightResponse { #[prost(int64, tag = "1")] @@ -87,16 +85,14 @@ pub struct GetValidatorSetByHeightResponse { #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } -/// GetLatestValidatorSetRequest is the request type for the -/// Query/GetValidatorSetByHeight RPC method. +/// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetRequest { /// pagination defines an pagination for the request. #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } -/// GetLatestValidatorSetResponse is the response type for the -/// Query/GetValidatorSetByHeight RPC method. +/// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetResponse { #[prost(int64, tag = "1")] @@ -113,21 +109,19 @@ pub struct Validator { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::prost_types::Any>, + pub pub_key: ::core::option::Option<::prost_wkt_types::Any>, #[prost(int64, tag = "3")] pub voting_power: i64, #[prost(int64, tag = "4")] pub proposer_priority: i64, } -/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight -/// RPC method. +/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightRequest { #[prost(int64, tag = "1")] pub height: i64, } -/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight -/// RPC method. +/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "1")] @@ -139,12 +133,10 @@ pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "3")] pub sdk_block: ::core::option::Option, } -/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC -/// method. +/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockRequest {} -/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC -/// method. +/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockResponse { #[prost(message, optional, tag = "1")] @@ -168,8 +160,7 @@ pub struct GetSyncingResponse { /// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoRequest {} -/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC -/// method. +/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoResponse { #[prost(message, optional, tag = "1")] @@ -223,8 +214,7 @@ pub struct AbciQueryRequest { #[prost(bool, tag = "4")] pub prove: bool, } -/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC -/// query. +/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. /// /// Note: This type is a duplicate of the ResponseQuery proto type defined in /// Tendermint. @@ -252,11 +242,10 @@ pub struct AbciQueryResponse { pub codespace: ::prost::alloc::string::String, } /// ProofOp defines an operation used for calculating Merkle root. The data could -/// be arbitrary format, providing nessecary data for example neighbouring node +/// be arbitrary format, providing necessary data for example neighbouring node /// hash. /// -/// Note: This type is a duplicate of the ProofOp proto type defined in -/// Tendermint. +/// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { #[prost(string, tag = "1")] @@ -268,8 +257,7 @@ pub struct ProofOp { } /// ProofOps is Merkle proof defined by the list of ProofOps. /// -/// Note: This type is a duplicate of the ProofOps proto type defined in -/// Tendermint. +/// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { #[prost(message, repeated, tag = "1")] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.serde.rs new file mode 100644 index 00000000..72459cb3 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.serde.rs @@ -0,0 +1,2819 @@ +impl serde::Serialize for AbciQueryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tendermint.v1beta1.ABCIQueryRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + struct_ser.serialize_field("path", &self.path)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if true { + struct_ser.serialize_field("prove", &self.prove)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AbciQueryRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + "path", + "height", + "prove", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + Path, + Height, + Prove, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + "path" => Ok(GeneratedField::Path), + "height" => Ok(GeneratedField::Height), + "prove" => Ok(GeneratedField::Prove), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AbciQueryRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ABCIQueryRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + let mut path__ = None; + let mut height__ = None; + let mut prove__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = Some(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::Prove => { + if prove__.is_some() { + return Err(serde::de::Error::duplicate_field("prove")); + } + prove__ = Some(map_.next_value()?); + } + } + } + Ok(AbciQueryRequest { + data: data__.unwrap_or_default(), + path: path__.unwrap_or_default(), + height: height__.unwrap_or_default(), + prove: prove__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.ABCIQueryRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AbciQueryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.base.tendermint.v1beta1.ABCIQueryResponse", len)?; + if true { + struct_ser.serialize_field("code", &self.code)?; + } + if true { + struct_ser.serialize_field("log", &self.log)?; + } + if true { + struct_ser.serialize_field("info", &self.info)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ::alloc::string::ToString::to_string(&self.index).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + if let Some(v) = self.proof_ops.as_ref() { + struct_ser.serialize_field("proofOps", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if true { + struct_ser.serialize_field("codespace", &self.codespace)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AbciQueryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code", + "log", + "info", + "index", + "key", + "value", + "proof_ops", + "proofOps", + "height", + "codespace", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Code, + Log, + Info, + Index, + Key, + Value, + ProofOps, + Height, + Codespace, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "code" => Ok(GeneratedField::Code), + "log" => Ok(GeneratedField::Log), + "info" => Ok(GeneratedField::Info), + "index" => Ok(GeneratedField::Index), + "key" => Ok(GeneratedField::Key), + "value" => Ok(GeneratedField::Value), + "proofOps" | "proof_ops" => Ok(GeneratedField::ProofOps), + "height" => Ok(GeneratedField::Height), + "codespace" => Ok(GeneratedField::Codespace), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AbciQueryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ABCIQueryResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code__ = None; + let mut log__ = None; + let mut info__ = None; + let mut index__ = None; + let mut key__ = None; + let mut value__ = None; + let mut proof_ops__ = None; + let mut height__ = None; + let mut codespace__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Code => { + if code__.is_some() { + return Err(serde::de::Error::duplicate_field("code")); + } + code__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Log => { + if log__.is_some() { + return Err(serde::de::Error::duplicate_field("log")); + } + log__ = Some(map_.next_value()?); + } + GeneratedField::Info => { + if info__.is_some() { + return Err(serde::de::Error::duplicate_field("info")); + } + info__ = Some(map_.next_value()?); + } + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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::ProofOps => { + if proof_ops__.is_some() { + return Err(serde::de::Error::duplicate_field("proofOps")); + } + proof_ops__ = 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::Codespace => { + if codespace__.is_some() { + return Err(serde::de::Error::duplicate_field("codespace")); + } + codespace__ = Some(map_.next_value()?); + } + } + } + Ok(AbciQueryResponse { + code: code__.unwrap_or_default(), + log: log__.unwrap_or_default(), + info: info__.unwrap_or_default(), + index: index__.unwrap_or_default(), + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + proof_ops: proof_ops__, + height: height__.unwrap_or_default(), + codespace: codespace__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.ABCIQueryResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Block { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tendermint.v1beta1.Block", len)?; + if let Some(v) = self.header.as_ref() { + struct_ser.serialize_field("header", v)?; + } + if let Some(v) = self.data.as_ref() { + struct_ser.serialize_field("data", v)?; + } + if let Some(v) = self.evidence.as_ref() { + struct_ser.serialize_field("evidence", v)?; + } + if let Some(v) = self.last_commit.as_ref() { + struct_ser.serialize_field("lastCommit", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Block { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "header", + "data", + "evidence", + "last_commit", + "lastCommit", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Header, + Data, + Evidence, + LastCommit, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "data" => Ok(GeneratedField::Data), + "evidence" => Ok(GeneratedField::Evidence), + "lastCommit" | "last_commit" => Ok(GeneratedField::LastCommit), + _ => 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; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.Block") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut header__ = None; + let mut data__ = None; + let mut evidence__ = None; + let mut last_commit__ = 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::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = map_.next_value()?; + } + GeneratedField::Evidence => { + if evidence__.is_some() { + return Err(serde::de::Error::duplicate_field("evidence")); + } + evidence__ = map_.next_value()?; + } + GeneratedField::LastCommit => { + if last_commit__.is_some() { + return Err(serde::de::Error::duplicate_field("lastCommit")); + } + last_commit__ = map_.next_value()?; + } + } + } + Ok(Block { + header: header__, + data: data__, + evidence: evidence__, + last_commit: last_commit__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.Block", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetBlockByHeightRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetBlockByHeightRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetBlockByHeightRequest { + #[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 = GetBlockByHeightRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest") + } + + 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(GetBlockByHeightRequest { + height: height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetBlockByHeightResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetBlockByHeightResponse", len)?; + if let Some(v) = self.block_id.as_ref() { + struct_ser.serialize_field("blockId", v)?; + } + if let Some(v) = self.block.as_ref() { + struct_ser.serialize_field("block", v)?; + } + if let Some(v) = self.sdk_block.as_ref() { + struct_ser.serialize_field("sdkBlock", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetBlockByHeightResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "block_id", + "blockId", + "block", + "sdk_block", + "sdkBlock", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BlockId, + Block, + SdkBlock, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "blockId" | "block_id" => Ok(GeneratedField::BlockId), + "block" => Ok(GeneratedField::Block), + "sdkBlock" | "sdk_block" => Ok(GeneratedField::SdkBlock), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetBlockByHeightResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut block_id__ = None; + let mut block__ = None; + let mut sdk_block__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BlockId => { + if block_id__.is_some() { + return Err(serde::de::Error::duplicate_field("blockId")); + } + block_id__ = map_.next_value()?; + } + GeneratedField::Block => { + if block__.is_some() { + return Err(serde::de::Error::duplicate_field("block")); + } + block__ = map_.next_value()?; + } + GeneratedField::SdkBlock => { + if sdk_block__.is_some() { + return Err(serde::de::Error::duplicate_field("sdkBlock")); + } + sdk_block__ = map_.next_value()?; + } + } + } + Ok(GetBlockByHeightResponse { + block_id: block_id__, + block: block__, + sdk_block: sdk_block__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetLatestBlockRequest { + #[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.tendermint.v1beta1.GetLatestBlockRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetLatestBlockRequest { + #[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 = GetLatestBlockRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetLatestBlockRequest") + } + + 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(GetLatestBlockRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetLatestBlockRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetLatestBlockResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetLatestBlockResponse", len)?; + if let Some(v) = self.block_id.as_ref() { + struct_ser.serialize_field("blockId", v)?; + } + if let Some(v) = self.block.as_ref() { + struct_ser.serialize_field("block", v)?; + } + if let Some(v) = self.sdk_block.as_ref() { + struct_ser.serialize_field("sdkBlock", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetLatestBlockResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "block_id", + "blockId", + "block", + "sdk_block", + "sdkBlock", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BlockId, + Block, + SdkBlock, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "blockId" | "block_id" => Ok(GeneratedField::BlockId), + "block" => Ok(GeneratedField::Block), + "sdkBlock" | "sdk_block" => Ok(GeneratedField::SdkBlock), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetLatestBlockResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetLatestBlockResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut block_id__ = None; + let mut block__ = None; + let mut sdk_block__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BlockId => { + if block_id__.is_some() { + return Err(serde::de::Error::duplicate_field("blockId")); + } + block_id__ = map_.next_value()?; + } + GeneratedField::Block => { + if block__.is_some() { + return Err(serde::de::Error::duplicate_field("block")); + } + block__ = map_.next_value()?; + } + GeneratedField::SdkBlock => { + if sdk_block__.is_some() { + return Err(serde::de::Error::duplicate_field("sdkBlock")); + } + sdk_block__ = map_.next_value()?; + } + } + } + Ok(GetLatestBlockResponse { + block_id: block_id__, + block: block__, + sdk_block: sdk_block__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetLatestBlockResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetLatestValidatorSetRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetLatestValidatorSetRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetLatestValidatorSetRequest { + #[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 = GetLatestValidatorSetRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest") + } + + 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(GetLatestValidatorSetRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetLatestValidatorSetResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetLatestValidatorSetResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("blockHeight", ::alloc::string::ToString::to_string(&self.block_height).as_str())?; + } + 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 GetLatestValidatorSetResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "block_height", + "blockHeight", + "validators", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BlockHeight, + 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 { + "blockHeight" | "block_height" => Ok(GeneratedField::BlockHeight), + "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 = GetLatestValidatorSetResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut block_height__ = None; + let mut validators__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BlockHeight => { + if block_height__.is_some() { + return Err(serde::de::Error::duplicate_field("blockHeight")); + } + block_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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(GetLatestValidatorSetResponse { + block_height: block_height__.unwrap_or_default(), + validators: validators__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetNodeInfoRequest { + #[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.tendermint.v1beta1.GetNodeInfoRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetNodeInfoRequest { + #[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 = GetNodeInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetNodeInfoRequest") + } + + 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(GetNodeInfoRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetNodeInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetNodeInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tendermint.v1beta1.GetNodeInfoResponse", len)?; + if let Some(v) = self.default_node_info.as_ref() { + struct_ser.serialize_field("defaultNodeInfo", v)?; + } + if let Some(v) = self.application_version.as_ref() { + struct_ser.serialize_field("applicationVersion", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "default_node_info", + "defaultNodeInfo", + "application_version", + "applicationVersion", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DefaultNodeInfo, + ApplicationVersion, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "defaultNodeInfo" | "default_node_info" => Ok(GeneratedField::DefaultNodeInfo), + "applicationVersion" | "application_version" => Ok(GeneratedField::ApplicationVersion), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetNodeInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetNodeInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut default_node_info__ = None; + let mut application_version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DefaultNodeInfo => { + if default_node_info__.is_some() { + return Err(serde::de::Error::duplicate_field("defaultNodeInfo")); + } + default_node_info__ = map_.next_value()?; + } + GeneratedField::ApplicationVersion => { + if application_version__.is_some() { + return Err(serde::de::Error::duplicate_field("applicationVersion")); + } + application_version__ = map_.next_value()?; + } + } + } + Ok(GetNodeInfoResponse { + default_node_info: default_node_info__, + application_version: application_version__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetNodeInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetSyncingRequest { + #[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.tendermint.v1beta1.GetSyncingRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetSyncingRequest { + #[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 = GetSyncingRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetSyncingRequest") + } + + 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(GetSyncingRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetSyncingRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetSyncingResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetSyncingResponse", len)?; + if true { + struct_ser.serialize_field("syncing", &self.syncing)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetSyncingResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "syncing", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Syncing, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "syncing" => Ok(GeneratedField::Syncing), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetSyncingResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetSyncingResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut syncing__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Syncing => { + if syncing__.is_some() { + return Err(serde::de::Error::duplicate_field("syncing")); + } + syncing__ = Some(map_.next_value()?); + } + } + } + Ok(GetSyncingResponse { + syncing: syncing__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetSyncingResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetValidatorSetByHeightRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tendermint.v1beta1.GetValidatorSetByHeightRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).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 GetValidatorSetByHeightRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + 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 { + "height" => Ok(GeneratedField::Height), + "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 = GetValidatorSetByHeightRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut pagination__ = 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::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(GetValidatorSetByHeightRequest { + height: height__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetValidatorSetByHeightResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.GetValidatorSetByHeightResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("blockHeight", ::alloc::string::ToString::to_string(&self.block_height).as_str())?; + } + 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 GetValidatorSetByHeightResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "block_height", + "blockHeight", + "validators", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BlockHeight, + 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 { + "blockHeight" | "block_height" => Ok(GeneratedField::BlockHeight), + "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 = GetValidatorSetByHeightResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut block_height__ = None; + let mut validators__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BlockHeight => { + if block_height__.is_some() { + return Err(serde::de::Error::duplicate_field("blockHeight")); + } + block_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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(GetValidatorSetByHeightResponse { + block_height: block_height__.unwrap_or_default(), + validators: validators__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", 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; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + 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.tendermint.v1beta1.Header", len)?; + if let Some(v) = self.version.as_ref() { + struct_ser.serialize_field("version", v)?; + } + if true { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.time.as_ref() { + struct_ser.serialize_field("time", v)?; + } + if let Some(v) = self.last_block_id.as_ref() { + struct_ser.serialize_field("lastBlockId", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("lastCommitHash", pbjson::private::base64::encode(&self.last_commit_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("dataHash", pbjson::private::base64::encode(&self.data_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("validatorsHash", pbjson::private::base64::encode(&self.validators_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("nextValidatorsHash", pbjson::private::base64::encode(&self.next_validators_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("consensusHash", pbjson::private::base64::encode(&self.consensus_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("appHash", pbjson::private::base64::encode(&self.app_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("lastResultsHash", pbjson::private::base64::encode(&self.last_results_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("evidenceHash", pbjson::private::base64::encode(&self.evidence_hash).as_str())?; + } + if true { + struct_ser.serialize_field("proposerAddress", &self.proposer_address)?; + } + 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] = &[ + "version", + "chain_id", + "chainId", + "height", + "time", + "last_block_id", + "lastBlockId", + "last_commit_hash", + "lastCommitHash", + "data_hash", + "dataHash", + "validators_hash", + "validatorsHash", + "next_validators_hash", + "nextValidatorsHash", + "consensus_hash", + "consensusHash", + "app_hash", + "appHash", + "last_results_hash", + "lastResultsHash", + "evidence_hash", + "evidenceHash", + "proposer_address", + "proposerAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + ChainId, + Height, + Time, + LastBlockId, + LastCommitHash, + DataHash, + ValidatorsHash, + NextValidatorsHash, + ConsensusHash, + AppHash, + LastResultsHash, + EvidenceHash, + ProposerAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "chainId" | "chain_id" => Ok(GeneratedField::ChainId), + "height" => Ok(GeneratedField::Height), + "time" => Ok(GeneratedField::Time), + "lastBlockId" | "last_block_id" => Ok(GeneratedField::LastBlockId), + "lastCommitHash" | "last_commit_hash" => Ok(GeneratedField::LastCommitHash), + "dataHash" | "data_hash" => Ok(GeneratedField::DataHash), + "validatorsHash" | "validators_hash" => Ok(GeneratedField::ValidatorsHash), + "nextValidatorsHash" | "next_validators_hash" => Ok(GeneratedField::NextValidatorsHash), + "consensusHash" | "consensus_hash" => Ok(GeneratedField::ConsensusHash), + "appHash" | "app_hash" => Ok(GeneratedField::AppHash), + "lastResultsHash" | "last_results_hash" => Ok(GeneratedField::LastResultsHash), + "evidenceHash" | "evidence_hash" => Ok(GeneratedField::EvidenceHash), + "proposerAddress" | "proposer_address" => Ok(GeneratedField::ProposerAddress), + _ => 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 cosmos.base.tendermint.v1beta1.Header") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut version__ = None; + let mut chain_id__ = None; + let mut height__ = None; + let mut time__ = None; + let mut last_block_id__ = None; + let mut last_commit_hash__ = None; + let mut data_hash__ = None; + let mut validators_hash__ = None; + let mut next_validators_hash__ = None; + let mut consensus_hash__ = None; + let mut app_hash__ = None; + let mut last_results_hash__ = None; + let mut evidence_hash__ = None; + let mut proposer_address__ = 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__ = map_.next_value()?; + } + 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__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Time => { + if time__.is_some() { + return Err(serde::de::Error::duplicate_field("time")); + } + time__ = map_.next_value()?; + } + GeneratedField::LastBlockId => { + if last_block_id__.is_some() { + return Err(serde::de::Error::duplicate_field("lastBlockId")); + } + last_block_id__ = map_.next_value()?; + } + GeneratedField::LastCommitHash => { + if last_commit_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("lastCommitHash")); + } + last_commit_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::DataHash => { + if data_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("dataHash")); + } + data_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ValidatorsHash => { + if validators_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorsHash")); + } + validators_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + 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) + ; + } + GeneratedField::ConsensusHash => { + if consensus_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusHash")); + } + consensus_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::AppHash => { + if app_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("appHash")); + } + app_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::LastResultsHash => { + if last_results_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("lastResultsHash")); + } + last_results_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::EvidenceHash => { + if evidence_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("evidenceHash")); + } + evidence_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProposerAddress => { + if proposer_address__.is_some() { + return Err(serde::de::Error::duplicate_field("proposerAddress")); + } + proposer_address__ = Some(map_.next_value()?); + } + } + } + Ok(Header { + version: version__, + chain_id: chain_id__.unwrap_or_default(), + height: height__.unwrap_or_default(), + time: time__, + last_block_id: last_block_id__, + last_commit_hash: last_commit_hash__.unwrap_or_default(), + data_hash: data_hash__.unwrap_or_default(), + validators_hash: validators_hash__.unwrap_or_default(), + next_validators_hash: next_validators_hash__.unwrap_or_default(), + consensus_hash: consensus_hash__.unwrap_or_default(), + app_hash: app_hash__.unwrap_or_default(), + last_results_hash: last_results_hash__.unwrap_or_default(), + evidence_hash: evidence_hash__.unwrap_or_default(), + proposer_address: proposer_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.Header", FIELDS, GeneratedVisitor) + } +} +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.base.tendermint.v1beta1.Module", len)?; + if true { + struct_ser.serialize_field("path", &self.path)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + struct_ser.serialize_field("sum", &self.sum)?; + } + 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] = &[ + "path", + "version", + "sum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Version, + Sum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "version" => Ok(GeneratedField::Version), + "sum" => Ok(GeneratedField::Sum), + _ => 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.base.tendermint.v1beta1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut version__ = None; + let mut sum__ = 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::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + GeneratedField::Sum => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("sum")); + } + sum__ = Some(map_.next_value()?); + } + } + } + Ok(Module { + path: path__.unwrap_or_default(), + version: version__.unwrap_or_default(), + sum: sum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.Module", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProofOp { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.ProofOp", len)?; + if true { + struct_ser.serialize_field("type", &self.r#type)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ProofOp { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "type", + "key", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Key, + 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 { + "type" => Ok(GeneratedField::Type), + "key" => Ok(GeneratedField::Key), + "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 = ProofOp; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ProofOp") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut r#type__ = None; + let mut key__ = None; + let mut data__ = 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()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + 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(ProofOp { + r#type: r#type__.unwrap_or_default(), + key: key__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.ProofOp", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProofOps { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.tendermint.v1beta1.ProofOps", len)?; + if true { + struct_ser.serialize_field("ops", &self.ops)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ProofOps { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ops", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ops, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ops" => Ok(GeneratedField::Ops), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProofOps; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ProofOps") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut ops__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Ops => { + if ops__.is_some() { + return Err(serde::de::Error::duplicate_field("ops")); + } + ops__ = Some(map_.next_value()?); + } + } + } + Ok(ProofOps { + ops: ops__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.ProofOps", 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; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.tendermint.v1beta1.Validator", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pub_key.as_ref() { + struct_ser.serialize_field("pubKey", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("votingPower", ::alloc::string::ToString::to_string(&self.voting_power).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposerPriority", ::alloc::string::ToString::to_string(&self.proposer_priority).as_str())?; + } + 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] = &[ + "address", + "pub_key", + "pubKey", + "voting_power", + "votingPower", + "proposer_priority", + "proposerPriority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + PubKey, + VotingPower, + ProposerPriority, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "votingPower" | "voting_power" => Ok(GeneratedField::VotingPower), + "proposerPriority" | "proposer_priority" => Ok(GeneratedField::ProposerPriority), + _ => 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.base.tendermint.v1beta1.Validator") + } + + 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 voting_power__ = None; + let mut proposer_priority__ = 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::VotingPower => { + if voting_power__.is_some() { + return Err(serde::de::Error::duplicate_field("votingPower")); + } + voting_power__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ProposerPriority => { + if proposer_priority__.is_some() { + return Err(serde::de::Error::duplicate_field("proposerPriority")); + } + proposer_priority__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Validator { + address: address__.unwrap_or_default(), + pub_key: pub_key__, + voting_power: voting_power__.unwrap_or_default(), + proposer_priority: proposer_priority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.Validator", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for VersionInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.base.tendermint.v1beta1.VersionInfo", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if true { + struct_ser.serialize_field("appName", &self.app_name)?; + } + if true { + struct_ser.serialize_field("version", &self.version)?; + } + if true { + struct_ser.serialize_field("gitCommit", &self.git_commit)?; + } + if true { + struct_ser.serialize_field("buildTags", &self.build_tags)?; + } + if true { + struct_ser.serialize_field("goVersion", &self.go_version)?; + } + if true { + struct_ser.serialize_field("buildDeps", &self.build_deps)?; + } + if true { + struct_ser.serialize_field("cosmosSdkVersion", &self.cosmos_sdk_version)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for VersionInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "app_name", + "appName", + "version", + "git_commit", + "gitCommit", + "build_tags", + "buildTags", + "go_version", + "goVersion", + "build_deps", + "buildDeps", + "cosmos_sdk_version", + "cosmosSdkVersion", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + AppName, + Version, + GitCommit, + BuildTags, + GoVersion, + BuildDeps, + CosmosSdkVersion, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "appName" | "app_name" => Ok(GeneratedField::AppName), + "version" => Ok(GeneratedField::Version), + "gitCommit" | "git_commit" => Ok(GeneratedField::GitCommit), + "buildTags" | "build_tags" => Ok(GeneratedField::BuildTags), + "goVersion" | "go_version" => Ok(GeneratedField::GoVersion), + "buildDeps" | "build_deps" => Ok(GeneratedField::BuildDeps), + "cosmosSdkVersion" | "cosmos_sdk_version" => Ok(GeneratedField::CosmosSdkVersion), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = VersionInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.VersionInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut app_name__ = None; + let mut version__ = None; + let mut git_commit__ = None; + let mut build_tags__ = None; + let mut go_version__ = None; + let mut build_deps__ = None; + let mut cosmos_sdk_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::AppName => { + if app_name__.is_some() { + return Err(serde::de::Error::duplicate_field("appName")); + } + app_name__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + GeneratedField::GitCommit => { + if git_commit__.is_some() { + return Err(serde::de::Error::duplicate_field("gitCommit")); + } + git_commit__ = Some(map_.next_value()?); + } + GeneratedField::BuildTags => { + if build_tags__.is_some() { + return Err(serde::de::Error::duplicate_field("buildTags")); + } + build_tags__ = Some(map_.next_value()?); + } + GeneratedField::GoVersion => { + if go_version__.is_some() { + return Err(serde::de::Error::duplicate_field("goVersion")); + } + go_version__ = Some(map_.next_value()?); + } + GeneratedField::BuildDeps => { + if build_deps__.is_some() { + return Err(serde::de::Error::duplicate_field("buildDeps")); + } + build_deps__ = Some(map_.next_value()?); + } + GeneratedField::CosmosSdkVersion => { + if cosmos_sdk_version__.is_some() { + return Err(serde::de::Error::duplicate_field("cosmosSdkVersion")); + } + cosmos_sdk_version__ = Some(map_.next_value()?); + } + } + } + Ok(VersionInfo { + name: name__.unwrap_or_default(), + app_name: app_name__.unwrap_or_default(), + version: version__.unwrap_or_default(), + git_commit: git_commit__.unwrap_or_default(), + build_tags: build_tags__.unwrap_or_default(), + go_version: go_version__.unwrap_or_default(), + build_deps: build_deps__.unwrap_or_default(), + cosmos_sdk_version: cosmos_sdk_version__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.tendermint.v1beta1.VersionInfo", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..91566588 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.rs new file mode 100644 index 00000000..1353f4e7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.rs @@ -0,0 +1,10 @@ +// @generated +/// Module is the config object of the capability module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped + /// keeper. For more details check x/capability/keeper.go. + #[prost(bool, tag = "1")] + pub seal_keeper: bool, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.serde.rs new file mode 100644 index 00000000..4c25a913 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.serde.rs @@ -0,0 +1,92 @@ +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.capability.module.v1.Module", len)?; + if true { + struct_ser.serialize_field("sealKeeper", &self.seal_keeper)?; + } + 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] = &[ + "seal_keeper", + "sealKeeper", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SealKeeper, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sealKeeper" | "seal_keeper" => Ok(GeneratedField::SealKeeper), + _ => 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.capability.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut seal_keeper__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SealKeeper => { + if seal_keeper__.is_some() { + return Err(serde::de::Error::duplicate_field("sealKeeper")); + } + seal_keeper__ = Some(map_.next_value()?); + } + } + } + Ok(Module { + seal_keeper: seal_keeper__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.capability.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs new file mode 100644 index 00000000..72ece39e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs @@ -0,0 +1,516 @@ +impl serde::Serialize for Capability { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.capability.v1beta1.Capability", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ::alloc::string::ToString::to_string(&self.index).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Capability { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "index", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "index" => Ok(GeneratedField::Index), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Capability; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.Capability") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut index__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Capability { + index: index__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.capability.v1beta1.Capability", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CapabilityOwners { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.capability.v1beta1.CapabilityOwners", len)?; + if true { + struct_ser.serialize_field("owners", &self.owners)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CapabilityOwners { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "owners", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owners, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "owners" => Ok(GeneratedField::Owners), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CapabilityOwners; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.CapabilityOwners") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut owners__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Owners => { + if owners__.is_some() { + return Err(serde::de::Error::duplicate_field("owners")); + } + owners__ = Some(map_.next_value()?); + } + } + } + Ok(CapabilityOwners { + owners: owners__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.capability.v1beta1.CapabilityOwners", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisOwners { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.capability.v1beta1.GenesisOwners", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ::alloc::string::ToString::to_string(&self.index).as_str())?; + } + if let Some(v) = self.index_owners.as_ref() { + struct_ser.serialize_field("indexOwners", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenesisOwners { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "index", + "index_owners", + "indexOwners", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + IndexOwners, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "index" => Ok(GeneratedField::Index), + "indexOwners" | "index_owners" => Ok(GeneratedField::IndexOwners), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisOwners; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.GenesisOwners") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut index__ = None; + let mut index_owners__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::IndexOwners => { + if index_owners__.is_some() { + return Err(serde::de::Error::duplicate_field("indexOwners")); + } + index_owners__ = map_.next_value()?; + } + } + } + Ok(GenesisOwners { + index: index__.unwrap_or_default(), + index_owners: index_owners__, + }) + } + } + deserializer.deserialize_struct("cosmos.capability.v1beta1.GenesisOwners", 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.capability.v1beta1.GenesisState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ::alloc::string::ToString::to_string(&self.index).as_str())?; + } + if true { + struct_ser.serialize_field("owners", &self.owners)?; + } + 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] = &[ + "index", + "owners", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + Owners, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "index" => Ok(GeneratedField::Index), + "owners" => Ok(GeneratedField::Owners), + _ => 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.capability.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut index__ = None; + let mut owners__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Owners => { + if owners__.is_some() { + return Err(serde::de::Error::duplicate_field("owners")); + } + owners__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + index: index__.unwrap_or_default(), + owners: owners__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.capability.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Owner { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.capability.v1beta1.Owner", len)?; + if true { + struct_ser.serialize_field("module", &self.module)?; + } + if true { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Owner { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module", + "name", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Module, + 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 { + "module" => Ok(GeneratedField::Module), + "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 = Owner; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.Owner") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module__ = None; + let mut name__ = 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()?); + } + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + } + } + Ok(Owner { + module: module__.unwrap_or_default(), + name: name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.capability.v1beta1.Owner", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.module.v1.rs new file mode 100644 index 00000000..eb857f8c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.module.v1.rs @@ -0,0 +1,9 @@ +// @generated +/// Module is the config object of the consensus module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.module.v1.serde.rs new file mode 100644 index 00000000..33485bae --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.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.consensus.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.consensus.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.consensus.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs new file mode 100644 index 00000000..2113beef --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs @@ -0,0 +1,37 @@ +// @generated +/// QueryParamsRequest defines the request type for querying x/consensus parameters. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse defines the response type for querying x/consensus parameters. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params are the tendermint consensus params stored in the consensus module. + /// Please note that `params.version` is not populated in this response, it is + /// tracked separately in the x/upgrade module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option<::tendermint_proto::v0_34::types::ConsensusParams>, +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/consensus parameters to update. + /// VersionsParams is not included in this Msg because it is tracked + /// separarately in x/upgrade. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub block: ::core::option::Option<::tendermint_proto::v0_34::types::BlockParams>, + #[prost(message, optional, tag = "3")] + pub evidence: ::core::option::Option<::tendermint_proto::v0_34::types::EvidenceParams>, + #[prost(message, optional, tag = "4")] + pub validator: ::core::option::Option<::tendermint_proto::v0_34::types::ValidatorParams>, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("cosmos.consensus.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs new file mode 100644 index 00000000..25d2d69f --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs @@ -0,0 +1,375 @@ +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; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.consensus.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.block.as_ref() { + struct_ser.serialize_field("block", v)?; + } + if let Some(v) = self.evidence.as_ref() { + struct_ser.serialize_field("evidence", v)?; + } + if let Some(v) = self.validator.as_ref() { + struct_ser.serialize_field("validator", 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", + "block", + "evidence", + "validator", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Block, + Evidence, + 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 { + "authority" => Ok(GeneratedField::Authority), + "block" => Ok(GeneratedField::Block), + "evidence" => Ok(GeneratedField::Evidence), + "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 = MsgUpdateParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.consensus.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut block__ = None; + let mut evidence__ = None; + let mut validator__ = 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::Block => { + if block__.is_some() { + return Err(serde::de::Error::duplicate_field("block")); + } + block__ = map_.next_value()?; + } + GeneratedField::Evidence => { + if evidence__.is_some() { + return Err(serde::de::Error::duplicate_field("evidence")); + } + evidence__ = map_.next_value()?; + } + GeneratedField::Validator => { + if validator__.is_some() { + return Err(serde::de::Error::duplicate_field("validator")); + } + validator__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + block: block__, + evidence: evidence__, + validator: validator__, + }) + } + } + deserializer.deserialize_struct("cosmos.consensus.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.consensus.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.consensus.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.consensus.v1.MsgUpdateParamsResponse", 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.consensus.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 cosmos.consensus.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("cosmos.consensus.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("cosmos.consensus.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 cosmos.consensus.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("cosmos.consensus.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs new file mode 100644 index 00000000..d98f3c67 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs @@ -0,0 +1,539 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.consensus.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.consensus.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.consensus.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.consensus.v1.Query"; + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.consensus.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.consensus.v1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.consensus.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.consensus.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.module.v1.rs new file mode 100644 index 00000000..bb1e24d7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.module.v1.rs @@ -0,0 +1,12 @@ +// @generated +/// Module is the config object of the crisis module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// fee_collector_name is the name of the FeeCollector ModuleAccount. + #[prost(string, tag = "1")] + pub fee_collector_name: ::prost::alloc::string::String, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.module.v1.serde.rs new file mode 100644 index 00000000..687fac8a --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.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.crisis.module.v1.Module", len)?; + if true { + struct_ser.serialize_field("feeCollectorName", &self.fee_collector_name)?; + } + 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] = &[ + "fee_collector_name", + "feeCollectorName", + "authority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FeeCollectorName, + 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 { + "feeCollectorName" | "fee_collector_name" => Ok(GeneratedField::FeeCollectorName), + "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.crisis.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee_collector_name__ = None; + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FeeCollectorName => { + if fee_collector_name__.is_some() { + return Err(serde::de::Error::duplicate_field("feeCollectorName")); + } + fee_collector_name__ = 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 { + fee_collector_name: fee_collector_name__.unwrap_or_default(), + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crisis.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs index b26eda40..26da7adc 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs @@ -10,15 +10,36 @@ pub struct GenesisState { /// MsgVerifyInvariant represents a message to verify a particular invariance. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVerifyInvariant { + /// sender is the account address of private key to send coins to fee collector account. #[prost(string, tag = "1")] pub sender: ::prost::alloc::string::String, + /// name of the invariant module. #[prost(string, tag = "2")] pub invariant_module_name: ::prost::alloc::string::String, + /// invariant_route is the msg's invariant route. #[prost(string, tag = "3")] pub invariant_route: ::prost::alloc::string::String, } /// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVerifyInvariantResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// constant_fee defines the x/crisis parameter. + #[prost(message, optional, tag = "2")] + pub constant_fee: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("cosmos.crisis.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.serde.rs new file mode 100644 index 00000000..ed563ac2 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.serde.rs @@ -0,0 +1,470 @@ +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crisis.v1beta1.GenesisState", len)?; + if let Some(v) = self.constant_fee.as_ref() { + struct_ser.serialize_field("constantFee", 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] = &[ + "constant_fee", + "constantFee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConstantFee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "constantFee" | "constant_fee" => Ok(GeneratedField::ConstantFee), + _ => 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.crisis.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut constant_fee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConstantFee => { + if constant_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("constantFee")); + } + constant_fee__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + constant_fee: constant_fee__, + }) + } + } + deserializer.deserialize_struct("cosmos.crisis.v1beta1.GenesisState", 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.crisis.v1beta1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.constant_fee.as_ref() { + struct_ser.serialize_field("constantFee", 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", + "constant_fee", + "constantFee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + ConstantFee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "constantFee" | "constant_fee" => Ok(GeneratedField::ConstantFee), + _ => 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.crisis.v1beta1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut constant_fee__ = 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::ConstantFee => { + if constant_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("constantFee")); + } + constant_fee__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + constant_fee: constant_fee__, + }) + } + } + deserializer.deserialize_struct("cosmos.crisis.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.crisis.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.crisis.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.crisis.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVerifyInvariant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.crisis.v1beta1.MsgVerifyInvariant", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("invariantModuleName", &self.invariant_module_name)?; + } + if true { + struct_ser.serialize_field("invariantRoute", &self.invariant_route)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVerifyInvariant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "invariant_module_name", + "invariantModuleName", + "invariant_route", + "invariantRoute", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + InvariantModuleName, + InvariantRoute, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "invariantModuleName" | "invariant_module_name" => Ok(GeneratedField::InvariantModuleName), + "invariantRoute" | "invariant_route" => Ok(GeneratedField::InvariantRoute), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVerifyInvariant; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crisis.v1beta1.MsgVerifyInvariant") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut invariant_module_name__ = None; + let mut invariant_route__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::InvariantModuleName => { + if invariant_module_name__.is_some() { + return Err(serde::de::Error::duplicate_field("invariantModuleName")); + } + invariant_module_name__ = Some(map_.next_value()?); + } + GeneratedField::InvariantRoute => { + if invariant_route__.is_some() { + return Err(serde::de::Error::duplicate_field("invariantRoute")); + } + invariant_route__ = Some(map_.next_value()?); + } + } + } + Ok(MsgVerifyInvariant { + sender: sender__.unwrap_or_default(), + invariant_module_name: invariant_module_name__.unwrap_or_default(), + invariant_route: invariant_route__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crisis.v1beta1.MsgVerifyInvariant", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVerifyInvariantResponse { + #[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.crisis.v1beta1.MsgVerifyInvariantResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVerifyInvariantResponse { + #[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 = MsgVerifyInvariantResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crisis.v1beta1.MsgVerifyInvariantResponse") + } + + 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(MsgVerifyInvariantResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.crisis.v1beta1.MsgVerifyInvariantResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs index a3235145..cae6939f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs @@ -103,6 +103,25 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.crisis.v1beta1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.crisis.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -117,6 +136,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -232,6 +255,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.crisis.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.serde.rs new file mode 100644 index 00000000..5d4a3dc7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.serde.rs @@ -0,0 +1,188 @@ +impl serde::Serialize for PrivKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.ed25519.PrivKey", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PrivKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PrivKey; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.ed25519.PrivKey") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PrivKey { + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.ed25519.PrivKey", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.ed25519.PubKey", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PubKey; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.ed25519.PubKey") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PubKey { + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.ed25519.PubKey", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.serde.rs new file mode 100644 index 00000000..1e466886 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs index 6f72e275..64d87fad 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs @@ -7,7 +7,7 @@ pub struct Record { pub name: ::prost::alloc::string::String, /// pub_key represents a public key in any format #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::prost_types::Any>, + pub pub_key: ::core::option::Option<::prost_wkt_types::Any>, /// Record contains one of the following items #[prost(oneof = "record::Item", tags = "3, 4, 5, 6")] pub item: ::core::option::Option, @@ -19,7 +19,7 @@ pub mod record { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Local { #[prost(message, optional, tag = "1")] - pub priv_key: ::core::option::Option<::prost_types::Any>, + pub priv_key: ::core::option::Option<::prost_wkt_types::Any>, } /// Ledger item #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.serde.rs new file mode 100644 index 00000000..1141663a --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.rs index 974b4bc0..17853d29 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.rs @@ -7,6 +7,6 @@ pub struct LegacyAminoPubKey { #[prost(uint32, tag = "1")] pub threshold: u32, #[prost(message, repeated, tag = "2")] - pub public_keys: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub public_keys: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.serde.rs new file mode 100644 index 00000000..f535b553 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.serde.rs new file mode 100644 index 00000000..3a12dfe6 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.serde.rs @@ -0,0 +1,208 @@ +impl serde::Serialize for CompactBitArray { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.multisig.v1beta1.CompactBitArray", len)?; + if true { + struct_ser.serialize_field("extraBitsStored", &self.extra_bits_stored)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("elems", pbjson::private::base64::encode(&self.elems).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CompactBitArray { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "extra_bits_stored", + "extraBitsStored", + "elems", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ExtraBitsStored, + Elems, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "extraBitsStored" | "extra_bits_stored" => Ok(GeneratedField::ExtraBitsStored), + "elems" => Ok(GeneratedField::Elems), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CompactBitArray; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.multisig.v1beta1.CompactBitArray") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut extra_bits_stored__ = None; + let mut elems__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ExtraBitsStored => { + if extra_bits_stored__.is_some() { + return Err(serde::de::Error::duplicate_field("extraBitsStored")); + } + extra_bits_stored__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Elems => { + if elems__.is_some() { + return Err(serde::de::Error::duplicate_field("elems")); + } + elems__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(CompactBitArray { + extra_bits_stored: extra_bits_stored__.unwrap_or_default(), + elems: elems__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.multisig.v1beta1.CompactBitArray", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MultiSignature { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.multisig.v1beta1.MultiSignature", len)?; + if true { + struct_ser.serialize_field("signatures", &self.signatures.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MultiSignature { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signatures, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signatures" => Ok(GeneratedField::Signatures), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MultiSignature; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.multisig.v1beta1.MultiSignature") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signatures__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signatures => { + if signatures__.is_some() { + return Err(serde::de::Error::duplicate_field("signatures")); + } + signatures__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(MultiSignature { + signatures: signatures__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.multisig.v1beta1.MultiSignature", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.serde.rs new file mode 100644 index 00000000..aaea5af5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.serde.rs @@ -0,0 +1,188 @@ +impl serde::Serialize for PrivKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256k1.PrivKey", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PrivKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PrivKey; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256k1.PrivKey") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PrivKey { + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.secp256k1.PrivKey", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256k1.PubKey", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PubKey; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256k1.PubKey") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PubKey { + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.secp256k1.PubKey", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.serde.rs new file mode 100644 index 00000000..f1cca10b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.serde.rs @@ -0,0 +1,188 @@ +impl serde::Serialize for PrivKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256r1.PrivKey", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("secret", pbjson::private::base64::encode(&self.secret).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PrivKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "secret", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Secret, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "secret" => Ok(GeneratedField::Secret), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PrivKey; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256r1.PrivKey") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut secret__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Secret => { + if secret__.is_some() { + return Err(serde::de::Error::duplicate_field("secret")); + } + secret__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PrivKey { + secret: secret__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.secp256r1.PrivKey", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256r1.PubKey", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "key" => Ok(GeneratedField::Key), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PubKey; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256r1.PubKey") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(PubKey { + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.crypto.secp256r1.PubKey", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.module.v1.rs new file mode 100644 index 00000000..1678eac6 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.module.v1.rs @@ -0,0 +1,11 @@ +// @generated +/// Module is the config object of the distribution module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + #[prost(string, tag = "1")] + pub fee_collector_name: ::prost::alloc::string::String, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.module.v1.serde.rs new file mode 100644 index 00000000..c13d65e6 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.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.distribution.module.v1.Module", len)?; + if true { + struct_ser.serialize_field("feeCollectorName", &self.fee_collector_name)?; + } + 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] = &[ + "fee_collector_name", + "feeCollectorName", + "authority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FeeCollectorName, + 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 { + "feeCollectorName" | "fee_collector_name" => Ok(GeneratedField::FeeCollectorName), + "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.distribution.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee_collector_name__ = None; + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FeeCollectorName => { + if fee_collector_name__.is_some() { + return Err(serde::de::Error::duplicate_field("feeCollectorName")); + } + fee_collector_name__ = 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 { + fee_collector_name: fee_collector_name__.unwrap_or_default(), + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs index 85d64736..ea8418e0 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs @@ -4,8 +4,14 @@ pub struct Params { #[prost(string, tag = "1")] pub community_tax: ::prost::alloc::string::String, + /// Deprecated: The base_proposer_reward field is deprecated and is no longer used + /// in the x/distribution module's reward mechanism. + #[deprecated] #[prost(string, tag = "2")] pub base_proposer_reward: ::prost::alloc::string::String, + /// Deprecated: The bonus_proposer_reward field is deprecated and is no longer used + /// in the x/distribution module's reward mechanism. + #[deprecated] #[prost(string, tag = "3")] pub bonus_proposer_reward: ::prost::alloc::string::String, #[prost(bool, tag = "4")] @@ -80,6 +86,11 @@ pub struct FeePool { /// CommunityPoolSpendProposal details a proposal for use of community funds, /// together with how many coins are proposed to be spent, and to which /// recipient account. +/// +/// Deprecated: Do not use. As of the Cosmos SDK release v0.47.x, there is no +/// longer a need for an explicit CommunityPoolSpendProposal. To spend community +/// pool funds, a simple MsgCommunityPoolSpend can be invoked from the x/gov +/// module via a v1 governance proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposal { #[prost(string, tag = "1")] @@ -148,7 +159,7 @@ pub struct ValidatorOutstandingRewardsRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, - /// outstanding_rewards represents the oustanding rewards of a validator. + /// outstanding_rewards represents the outstanding rewards of a validator. #[prost(message, repeated, tag = "2")] pub outstanding_rewards: ::prost::alloc::vec::Vec, } @@ -206,7 +217,7 @@ pub struct ValidatorSlashEventRecord { /// validator_address is the address of the validator. #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, - /// height defines the block height at which the slash event occured. + /// height defines the block height at which the slash event occurred. #[prost(uint64, tag = "2")] pub height: u64, /// period is the period of the slash event. @@ -219,7 +230,7 @@ pub struct ValidatorSlashEventRecord { /// GenesisState defines the distribution module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { - /// params defines all the paramaters of the module. + /// params defines all the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// fee_pool defines the fee pool at genesis. @@ -234,7 +245,7 @@ pub struct GenesisState { /// fee_pool defines the outstanding rewards of all validators at genesis. #[prost(message, repeated, tag = "5")] pub outstanding_rewards: ::prost::alloc::vec::Vec, - /// fee_pool defines the accumulated commisions of all validators at genesis. + /// fee_pool defines the accumulated commissions of all validators at genesis. #[prost(message, repeated, tag = "6")] pub validator_accumulated_commissions: ::prost::alloc::vec::Vec, @@ -261,6 +272,26 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryValidatorDistributionInfoRequest is the request type for the Query/ValidatorDistributionInfo RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryValidatorDistributionInfoRequest { + /// validator_address defines the validator address to query for. + #[prost(string, tag = "1")] + pub validator_address: ::prost::alloc::string::String, +} +/// QueryValidatorDistributionInfoResponse is the response type for the Query/ValidatorDistributionInfo RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryValidatorDistributionInfoResponse { + /// operator_address defines the validator operator address. + #[prost(string, tag = "1")] + pub operator_address: ::prost::alloc::string::String, + /// self_bond_rewards defines the self delegations rewards. + #[prost(message, repeated, tag = "2")] + pub self_bond_rewards: ::prost::alloc::vec::Vec, + /// commission defines the commission the validator received. + #[prost(message, repeated, tag = "3")] + pub commission: ::prost::alloc::vec::Vec, +} /// QueryValidatorOutstandingRewardsRequest is the request type for the /// Query/ValidatorOutstandingRewards RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -288,7 +319,7 @@ pub struct QueryValidatorCommissionRequest { /// Query/ValidatorCommission RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionResponse { - /// commission defines the commision the validator received. + /// commission defines the commission the validator received. #[prost(message, optional, tag = "1")] pub commission: ::core::option::Option, } @@ -411,7 +442,8 @@ pub struct MsgSetWithdrawAddress { #[prost(string, tag = "2")] pub withdraw_address: ::prost::alloc::string::String, } -/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +/// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response +/// type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddressResponse {} /// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator @@ -423,7 +455,8 @@ pub struct MsgWithdrawDelegatorReward { #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, } -/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +/// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward +/// response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorRewardResponse { /// Since: cosmos-sdk 0.46 @@ -437,7 +470,8 @@ pub struct MsgWithdrawValidatorCommission { #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } -/// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +/// MsgWithdrawValidatorCommissionResponse defines the +/// Msg/WithdrawValidatorCommission response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommissionResponse { /// Since: cosmos-sdk 0.46 @@ -456,5 +490,46 @@ pub struct MsgFundCommunityPool { /// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPoolResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/distribution parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +/// MsgCommunityPoolSpend defines a message for sending tokens from the community +/// pool to another account. This message is typically executed via a governance +/// proposal with the governance module being the executing authority. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCommunityPoolSpend { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub recipient: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgCommunityPoolSpendResponse defines the response to executing a +/// MsgCommunityPoolSpend message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCommunityPoolSpendResponse {} include!("cosmos.distribution.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs new file mode 100644 index 00000000..5dfea659 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs @@ -0,0 +1,5542 @@ +impl serde::Serialize for CommunityPoolSpendProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.distribution.v1beta1.CommunityPoolSpendProposal", 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("recipient", &self.recipient)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CommunityPoolSpendProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "recipient", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Recipient, + 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 { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + "recipient" => Ok(GeneratedField::Recipient), + "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 = CommunityPoolSpendProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.CommunityPoolSpendProposal") + } + + 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 recipient__ = None; + let mut amount__ = 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::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(CommunityPoolSpendProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.CommunityPoolSpendProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CommunityPoolSpendProposalWithDeposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", 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("recipient", &self.recipient)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + if true { + struct_ser.serialize_field("deposit", &self.deposit)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CommunityPoolSpendProposalWithDeposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "recipient", + "amount", + "deposit", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Recipient, + Amount, + 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 { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + "recipient" => Ok(GeneratedField::Recipient), + "amount" => Ok(GeneratedField::Amount), + "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 = CommunityPoolSpendProposalWithDeposit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit") + } + + 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 recipient__ = None; + let mut amount__ = None; + let mut deposit__ = 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::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + GeneratedField::Deposit => { + if deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("deposit")); + } + deposit__ = Some(map_.next_value()?); + } + } + } + Ok(CommunityPoolSpendProposalWithDeposit { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + deposit: deposit__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DelegationDelegatorReward { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.DelegationDelegatorReward", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + struct_ser.serialize_field("reward", &self.reward)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DelegationDelegatorReward { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "reward", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Reward, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "reward" => Ok(GeneratedField::Reward), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DelegationDelegatorReward; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegationDelegatorReward") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut reward__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Reward => { + if reward__.is_some() { + return Err(serde::de::Error::duplicate_field("reward")); + } + reward__ = Some(map_.next_value()?); + } + } + } + Ok(DelegationDelegatorReward { + validator_address: validator_address__.unwrap_or_default(), + reward: reward__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.DelegationDelegatorReward", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DelegatorStartingInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.distribution.v1beta1.DelegatorStartingInfo", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("previousPeriod", ::alloc::string::ToString::to_string(&self.previous_period).as_str())?; + } + if true { + struct_ser.serialize_field("stake", &self.stake)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DelegatorStartingInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "previous_period", + "previousPeriod", + "stake", + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PreviousPeriod, + Stake, + 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 { + "previousPeriod" | "previous_period" => Ok(GeneratedField::PreviousPeriod), + "stake" => Ok(GeneratedField::Stake), + "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 = DelegatorStartingInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegatorStartingInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut previous_period__ = None; + let mut stake__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PreviousPeriod => { + if previous_period__.is_some() { + return Err(serde::de::Error::duplicate_field("previousPeriod")); + } + previous_period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Stake => { + if stake__.is_some() { + return Err(serde::de::Error::duplicate_field("stake")); + } + stake__ = Some(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) + ; + } + } + } + Ok(DelegatorStartingInfo { + previous_period: previous_period__.unwrap_or_default(), + stake: stake__.unwrap_or_default(), + height: height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.DelegatorStartingInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DelegatorStartingInfoRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.distribution.v1beta1.DelegatorStartingInfoRecord", 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.starting_info.as_ref() { + struct_ser.serialize_field("startingInfo", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DelegatorStartingInfoRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "starting_info", + "startingInfo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + StartingInfo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "startingInfo" | "starting_info" => Ok(GeneratedField::StartingInfo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DelegatorStartingInfoRecord; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegatorStartingInfoRecord") + } + + 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 starting_info__ = 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::StartingInfo => { + if starting_info__.is_some() { + return Err(serde::de::Error::duplicate_field("startingInfo")); + } + starting_info__ = map_.next_value()?; + } + } + } + Ok(DelegatorStartingInfoRecord { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + starting_info: starting_info__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.DelegatorStartingInfoRecord", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DelegatorWithdrawInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.DelegatorWithdrawInfo", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("withdrawAddress", &self.withdraw_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DelegatorWithdrawInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "withdraw_address", + "withdrawAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + WithdrawAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "withdrawAddress" | "withdraw_address" => Ok(GeneratedField::WithdrawAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DelegatorWithdrawInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegatorWithdrawInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut withdraw_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::WithdrawAddress => { + if withdraw_address__.is_some() { + return Err(serde::de::Error::duplicate_field("withdrawAddress")); + } + withdraw_address__ = Some(map_.next_value()?); + } + } + } + Ok(DelegatorWithdrawInfo { + delegator_address: delegator_address__.unwrap_or_default(), + withdraw_address: withdraw_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.DelegatorWithdrawInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FeePool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.FeePool", len)?; + if true { + struct_ser.serialize_field("communityPool", &self.community_pool)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeePool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "community_pool", + "communityPool", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CommunityPool, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "communityPool" | "community_pool" => Ok(GeneratedField::CommunityPool), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeePool; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.FeePool") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut community_pool__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CommunityPool => { + if community_pool__.is_some() { + return Err(serde::de::Error::duplicate_field("communityPool")); + } + community_pool__ = Some(map_.next_value()?); + } + } + } + Ok(FeePool { + community_pool: community_pool__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.FeePool", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if let Some(v) = self.fee_pool.as_ref() { + struct_ser.serialize_field("feePool", v)?; + } + if true { + struct_ser.serialize_field("delegatorWithdrawInfos", &self.delegator_withdraw_infos)?; + } + if true { + struct_ser.serialize_field("previousProposer", &self.previous_proposer)?; + } + if true { + struct_ser.serialize_field("outstandingRewards", &self.outstanding_rewards)?; + } + if true { + struct_ser.serialize_field("validatorAccumulatedCommissions", &self.validator_accumulated_commissions)?; + } + if true { + struct_ser.serialize_field("validatorHistoricalRewards", &self.validator_historical_rewards)?; + } + if true { + struct_ser.serialize_field("validatorCurrentRewards", &self.validator_current_rewards)?; + } + if true { + struct_ser.serialize_field("delegatorStartingInfos", &self.delegator_starting_infos)?; + } + if true { + struct_ser.serialize_field("validatorSlashEvents", &self.validator_slash_events)?; + } + 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", + "fee_pool", + "feePool", + "delegator_withdraw_infos", + "delegatorWithdrawInfos", + "previous_proposer", + "previousProposer", + "outstanding_rewards", + "outstandingRewards", + "validator_accumulated_commissions", + "validatorAccumulatedCommissions", + "validator_historical_rewards", + "validatorHistoricalRewards", + "validator_current_rewards", + "validatorCurrentRewards", + "delegator_starting_infos", + "delegatorStartingInfos", + "validator_slash_events", + "validatorSlashEvents", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + FeePool, + DelegatorWithdrawInfos, + PreviousProposer, + OutstandingRewards, + ValidatorAccumulatedCommissions, + ValidatorHistoricalRewards, + ValidatorCurrentRewards, + DelegatorStartingInfos, + ValidatorSlashEvents, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "feePool" | "fee_pool" => Ok(GeneratedField::FeePool), + "delegatorWithdrawInfos" | "delegator_withdraw_infos" => Ok(GeneratedField::DelegatorWithdrawInfos), + "previousProposer" | "previous_proposer" => Ok(GeneratedField::PreviousProposer), + "outstandingRewards" | "outstanding_rewards" => Ok(GeneratedField::OutstandingRewards), + "validatorAccumulatedCommissions" | "validator_accumulated_commissions" => Ok(GeneratedField::ValidatorAccumulatedCommissions), + "validatorHistoricalRewards" | "validator_historical_rewards" => Ok(GeneratedField::ValidatorHistoricalRewards), + "validatorCurrentRewards" | "validator_current_rewards" => Ok(GeneratedField::ValidatorCurrentRewards), + "delegatorStartingInfos" | "delegator_starting_infos" => Ok(GeneratedField::DelegatorStartingInfos), + "validatorSlashEvents" | "validator_slash_events" => Ok(GeneratedField::ValidatorSlashEvents), + _ => 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.distribution.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut fee_pool__ = None; + let mut delegator_withdraw_infos__ = None; + let mut previous_proposer__ = None; + let mut outstanding_rewards__ = None; + let mut validator_accumulated_commissions__ = None; + let mut validator_historical_rewards__ = None; + let mut validator_current_rewards__ = None; + let mut delegator_starting_infos__ = None; + let mut validator_slash_events__ = 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::FeePool => { + if fee_pool__.is_some() { + return Err(serde::de::Error::duplicate_field("feePool")); + } + fee_pool__ = map_.next_value()?; + } + GeneratedField::DelegatorWithdrawInfos => { + if delegator_withdraw_infos__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorWithdrawInfos")); + } + delegator_withdraw_infos__ = Some(map_.next_value()?); + } + GeneratedField::PreviousProposer => { + if previous_proposer__.is_some() { + return Err(serde::de::Error::duplicate_field("previousProposer")); + } + previous_proposer__ = Some(map_.next_value()?); + } + GeneratedField::OutstandingRewards => { + if outstanding_rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("outstandingRewards")); + } + outstanding_rewards__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAccumulatedCommissions => { + if validator_accumulated_commissions__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAccumulatedCommissions")); + } + validator_accumulated_commissions__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorHistoricalRewards => { + if validator_historical_rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorHistoricalRewards")); + } + validator_historical_rewards__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorCurrentRewards => { + if validator_current_rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorCurrentRewards")); + } + validator_current_rewards__ = Some(map_.next_value()?); + } + GeneratedField::DelegatorStartingInfos => { + if delegator_starting_infos__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorStartingInfos")); + } + delegator_starting_infos__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorSlashEvents => { + if validator_slash_events__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSlashEvents")); + } + validator_slash_events__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + fee_pool: fee_pool__, + delegator_withdraw_infos: delegator_withdraw_infos__.unwrap_or_default(), + previous_proposer: previous_proposer__.unwrap_or_default(), + outstanding_rewards: outstanding_rewards__.unwrap_or_default(), + validator_accumulated_commissions: validator_accumulated_commissions__.unwrap_or_default(), + validator_historical_rewards: validator_historical_rewards__.unwrap_or_default(), + validator_current_rewards: validator_current_rewards__.unwrap_or_default(), + delegator_starting_infos: delegator_starting_infos__.unwrap_or_default(), + validator_slash_events: validator_slash_events__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCommunityPoolSpend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.distribution.v1beta1.MsgCommunityPoolSpend", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if true { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authority", + "recipient", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Recipient, + 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 { + "authority" => Ok(GeneratedField::Authority), + "recipient" => Ok(GeneratedField::Recipient), + "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 = MsgCommunityPoolSpend; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgCommunityPoolSpend") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut recipient__ = None; + let mut amount__ = 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::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCommunityPoolSpend { + authority: authority__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgCommunityPoolSpend", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCommunityPoolSpendResponse { + #[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.distribution.v1beta1.MsgCommunityPoolSpendResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpendResponse { + #[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 = MsgCommunityPoolSpendResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse") + } + + 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(MsgCommunityPoolSpendResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgFundCommunityPool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.MsgFundCommunityPool", len)?; + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgFundCommunityPool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "amount", + "depositor", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + 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 { + "amount" => Ok(GeneratedField::Amount), + "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 = MsgFundCommunityPool; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgFundCommunityPool") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amount__ = None; + let mut depositor__ = 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__ = Some(map_.next_value()?); + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + } + } + Ok(MsgFundCommunityPool { + amount: amount__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgFundCommunityPool", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgFundCommunityPoolResponse { + #[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.distribution.v1beta1.MsgFundCommunityPoolResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgFundCommunityPoolResponse { + #[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 = MsgFundCommunityPoolResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") + } + + 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(MsgFundCommunityPoolResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSetWithdrawAddress { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.MsgSetWithdrawAddress", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("withdrawAddress", &self.withdraw_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSetWithdrawAddress { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "withdraw_address", + "withdrawAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + WithdrawAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "withdrawAddress" | "withdraw_address" => Ok(GeneratedField::WithdrawAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSetWithdrawAddress; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgSetWithdrawAddress") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut withdraw_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::WithdrawAddress => { + if withdraw_address__.is_some() { + return Err(serde::de::Error::duplicate_field("withdrawAddress")); + } + withdraw_address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgSetWithdrawAddress { + delegator_address: delegator_address__.unwrap_or_default(), + withdraw_address: withdraw_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgSetWithdrawAddress", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSetWithdrawAddressResponse { + #[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.distribution.v1beta1.MsgSetWithdrawAddressResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSetWithdrawAddressResponse { + #[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 = MsgSetWithdrawAddressResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") + } + + 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(MsgSetWithdrawAddressResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse", 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.distribution.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.distribution.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.distribution.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.distribution.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.distribution.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.distribution.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgWithdrawDelegatorReward { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", 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 MsgWithdrawDelegatorReward { + #[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 = MsgWithdrawDelegatorReward; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") + } + + 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(MsgWithdrawDelegatorReward { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgWithdrawDelegatorRewardResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", len)?; + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgWithdrawDelegatorRewardResponse { + #[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 = MsgWithdrawDelegatorRewardResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse") + } + + 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__ = Some(map_.next_value()?); + } + } + } + Ok(MsgWithdrawDelegatorRewardResponse { + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgWithdrawValidatorCommission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgWithdrawValidatorCommission { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = MsgWithdrawValidatorCommission; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgWithdrawValidatorCommission { + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgWithdrawValidatorCommissionResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", len)?; + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgWithdrawValidatorCommissionResponse { + #[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 = MsgWithdrawValidatorCommissionResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse") + } + + 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__ = Some(map_.next_value()?); + } + } + } + Ok(MsgWithdrawValidatorCommissionResponse { + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", 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; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.Params", len)?; + if true { + struct_ser.serialize_field("communityTax", &self.community_tax)?; + } + if true { + struct_ser.serialize_field("baseProposerReward", &self.base_proposer_reward)?; + } + if true { + struct_ser.serialize_field("bonusProposerReward", &self.bonus_proposer_reward)?; + } + if true { + struct_ser.serialize_field("withdrawAddrEnabled", &self.withdraw_addr_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] = &[ + "community_tax", + "communityTax", + "base_proposer_reward", + "baseProposerReward", + "bonus_proposer_reward", + "bonusProposerReward", + "withdraw_addr_enabled", + "withdrawAddrEnabled", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CommunityTax, + BaseProposerReward, + BonusProposerReward, + WithdrawAddrEnabled, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "communityTax" | "community_tax" => Ok(GeneratedField::CommunityTax), + "baseProposerReward" | "base_proposer_reward" => Ok(GeneratedField::BaseProposerReward), + "bonusProposerReward" | "bonus_proposer_reward" => Ok(GeneratedField::BonusProposerReward), + "withdrawAddrEnabled" | "withdraw_addr_enabled" => Ok(GeneratedField::WithdrawAddrEnabled), + _ => 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.distribution.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut community_tax__ = None; + let mut base_proposer_reward__ = None; + let mut bonus_proposer_reward__ = None; + let mut withdraw_addr_enabled__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CommunityTax => { + if community_tax__.is_some() { + return Err(serde::de::Error::duplicate_field("communityTax")); + } + community_tax__ = Some(map_.next_value()?); + } + GeneratedField::BaseProposerReward => { + if base_proposer_reward__.is_some() { + return Err(serde::de::Error::duplicate_field("baseProposerReward")); + } + base_proposer_reward__ = Some(map_.next_value()?); + } + GeneratedField::BonusProposerReward => { + if bonus_proposer_reward__.is_some() { + return Err(serde::de::Error::duplicate_field("bonusProposerReward")); + } + bonus_proposer_reward__ = Some(map_.next_value()?); + } + GeneratedField::WithdrawAddrEnabled => { + if withdraw_addr_enabled__.is_some() { + return Err(serde::de::Error::duplicate_field("withdrawAddrEnabled")); + } + withdraw_addr_enabled__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + community_tax: community_tax__.unwrap_or_default(), + base_proposer_reward: base_proposer_reward__.unwrap_or_default(), + bonus_proposer_reward: bonus_proposer_reward__.unwrap_or_default(), + withdraw_addr_enabled: withdraw_addr_enabled__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCommunityPoolRequest { + #[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.distribution.v1beta1.QueryCommunityPoolRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCommunityPoolRequest { + #[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 = QueryCommunityPoolRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryCommunityPoolRequest") + } + + 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(QueryCommunityPoolRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryCommunityPoolRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCommunityPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryCommunityPoolResponse", len)?; + if true { + struct_ser.serialize_field("pool", &self.pool)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCommunityPoolResponse { + #[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 = QueryCommunityPoolResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryCommunityPoolResponse") + } + + 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__ = Some(map_.next_value()?); + } + } + } + Ok(QueryCommunityPoolResponse { + pool: pool__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryCommunityPoolResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegationRewardsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", 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 QueryDelegationRewardsRequest { + #[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 = QueryDelegationRewardsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryDelegationRewardsRequest") + } + + 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(QueryDelegationRewardsRequest { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegationRewardsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", len)?; + if true { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegationRewardsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rewards", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rewards" => Ok(GeneratedField::Rewards), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegationRewardsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryDelegationRewardsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rewards__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDelegationRewardsResponse { + rewards: rewards__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegationTotalRewardsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegationTotalRewardsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegationTotalRewardsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_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()?); + } + } + } + Ok(QueryDelegationTotalRewardsRequest { + delegator_address: delegator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegationTotalRewardsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", len)?; + if true { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + if true { + struct_ser.serialize_field("total", &self.total)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegationTotalRewardsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rewards", + "total", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + 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 { + "rewards" => Ok(GeneratedField::Rewards), + "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 = QueryDelegationTotalRewardsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rewards__ = None; + let mut total__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = Some(map_.next_value()?); + } + GeneratedField::Total => { + if total__.is_some() { + return Err(serde::de::Error::duplicate_field("total")); + } + total__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDelegationTotalRewardsResponse { + rewards: rewards__.unwrap_or_default(), + total: total__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", 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; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + 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_address", + "delegatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => 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.distribution.v1beta1.QueryDelegatorValidatorsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_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()?); + } + } + } + Ok(QueryDelegatorValidatorsRequest { + delegator_address: delegator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.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; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", len)?; + if true { + struct_ser.serialize_field("validators", &self.validators)?; + } + 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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validators, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => 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.distribution.v1beta1.QueryDelegatorValidatorsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validators__ = 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()?); + } + } + } + Ok(QueryDelegatorValidatorsResponse { + validators: validators__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorWithdrawAddressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorWithdrawAddressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorWithdrawAddressRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_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()?); + } + } + } + Ok(QueryDelegatorWithdrawAddressRequest { + delegator_address: delegator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorWithdrawAddressResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", len)?; + if true { + struct_ser.serialize_field("withdrawAddress", &self.withdraw_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorWithdrawAddressResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "withdraw_address", + "withdrawAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + WithdrawAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "withdrawAddress" | "withdraw_address" => Ok(GeneratedField::WithdrawAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorWithdrawAddressResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut withdraw_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::WithdrawAddress => { + if withdraw_address__.is_some() { + return Err(serde::de::Error::duplicate_field("withdrawAddress")); + } + withdraw_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDelegatorWithdrawAddressResponse { + withdraw_address: withdraw_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", 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.distribution.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.distribution.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.distribution.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.distribution.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.distribution.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.distribution.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorCommissionRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorCommissionRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryValidatorCommissionRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorCommissionRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidatorCommissionRequest { + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorCommissionResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", len)?; + if let Some(v) = self.commission.as_ref() { + struct_ser.serialize_field("commission", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorCommissionResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "commission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "commission" => Ok(GeneratedField::Commission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorCommissionResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorCommissionResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Commission => { + if commission__.is_some() { + return Err(serde::de::Error::duplicate_field("commission")); + } + commission__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorCommissionResponse { + commission: commission__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorDistributionInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorDistributionInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryValidatorDistributionInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidatorDistributionInfoRequest { + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorDistributionInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.distribution.v1beta1.QueryValidatorDistributionInfoResponse", len)?; + if true { + struct_ser.serialize_field("operatorAddress", &self.operator_address)?; + } + if true { + struct_ser.serialize_field("selfBondRewards", &self.self_bond_rewards)?; + } + if true { + struct_ser.serialize_field("commission", &self.commission)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorDistributionInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "operator_address", + "operatorAddress", + "self_bond_rewards", + "selfBondRewards", + "commission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + OperatorAddress, + SelfBondRewards, + Commission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "selfBondRewards" | "self_bond_rewards" => Ok(GeneratedField::SelfBondRewards), + "commission" => Ok(GeneratedField::Commission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorDistributionInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut operator_address__ = None; + let mut self_bond_rewards__ = None; + let mut commission__ = 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::SelfBondRewards => { + if self_bond_rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("selfBondRewards")); + } + self_bond_rewards__ = Some(map_.next_value()?); + } + GeneratedField::Commission => { + if commission__.is_some() { + return Err(serde::de::Error::duplicate_field("commission")); + } + commission__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidatorDistributionInfoResponse { + operator_address: operator_address__.unwrap_or_default(), + self_bond_rewards: self_bond_rewards__.unwrap_or_default(), + commission: commission__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorOutstandingRewardsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorOutstandingRewardsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryValidatorOutstandingRewardsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidatorOutstandingRewardsRequest { + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorOutstandingRewardsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", len)?; + if let Some(v) = self.rewards.as_ref() { + struct_ser.serialize_field("rewards", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorOutstandingRewardsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rewards", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rewards" => Ok(GeneratedField::Rewards), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorOutstandingRewardsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rewards__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorOutstandingRewardsResponse { + rewards: rewards__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorSlashesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.distribution.v1beta1.QueryValidatorSlashesRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startingHeight", ::alloc::string::ToString::to_string(&self.starting_height).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endingHeight", ::alloc::string::ToString::to_string(&self.ending_height).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 QueryValidatorSlashesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "starting_height", + "startingHeight", + "ending_height", + "endingHeight", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + StartingHeight, + EndingHeight, + 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 { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "startingHeight" | "starting_height" => Ok(GeneratedField::StartingHeight), + "endingHeight" | "ending_height" => Ok(GeneratedField::EndingHeight), + "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 = QueryValidatorSlashesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorSlashesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut starting_height__ = None; + let mut ending_height__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::StartingHeight => { + if starting_height__.is_some() { + return Err(serde::de::Error::duplicate_field("startingHeight")); + } + starting_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::EndingHeight => { + if ending_height__.is_some() { + return Err(serde::de::Error::duplicate_field("endingHeight")); + } + ending_height__ = + 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(QueryValidatorSlashesRequest { + validator_address: validator_address__.unwrap_or_default(), + starting_height: starting_height__.unwrap_or_default(), + ending_height: ending_height__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorSlashesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorSlashesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", len)?; + if true { + struct_ser.serialize_field("slashes", &self.slashes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorSlashesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "slashes", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Slashes, + 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 { + "slashes" => Ok(GeneratedField::Slashes), + "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 = QueryValidatorSlashesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryValidatorSlashesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut slashes__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Slashes => { + if slashes__.is_some() { + return Err(serde::de::Error::duplicate_field("slashes")); + } + slashes__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorSlashesResponse { + slashes: slashes__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorAccumulatedCommission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", len)?; + if true { + struct_ser.serialize_field("commission", &self.commission)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorAccumulatedCommission { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "commission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "commission" => Ok(GeneratedField::Commission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorAccumulatedCommission; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorAccumulatedCommission") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Commission => { + if commission__.is_some() { + return Err(serde::de::Error::duplicate_field("commission")); + } + commission__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorAccumulatedCommission { + commission: commission__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorAccumulatedCommissionRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.accumulated.as_ref() { + struct_ser.serialize_field("accumulated", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorAccumulatedCommissionRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "accumulated", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Accumulated, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "accumulated" => Ok(GeneratedField::Accumulated), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorAccumulatedCommissionRecord; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut accumulated__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Accumulated => { + if accumulated__.is_some() { + return Err(serde::de::Error::duplicate_field("accumulated")); + } + accumulated__ = map_.next_value()?; + } + } + } + Ok(ValidatorAccumulatedCommissionRecord { + validator_address: validator_address__.unwrap_or_default(), + accumulated: accumulated__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorCurrentRewards { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorCurrentRewards", len)?; + if true { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("period", ::alloc::string::ToString::to_string(&self.period).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorCurrentRewards { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rewards", + "period", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + Period, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rewards" => Ok(GeneratedField::Rewards), + "period" => Ok(GeneratedField::Period), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorCurrentRewards; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorCurrentRewards") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rewards__ = None; + let mut period__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = Some(map_.next_value()?); + } + GeneratedField::Period => { + if period__.is_some() { + return Err(serde::de::Error::duplicate_field("period")); + } + period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ValidatorCurrentRewards { + rewards: rewards__.unwrap_or_default(), + period: period__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorCurrentRewards", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorCurrentRewardsRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.rewards.as_ref() { + struct_ser.serialize_field("rewards", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorCurrentRewardsRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "rewards", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Rewards, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "rewards" => Ok(GeneratedField::Rewards), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorCurrentRewardsRecord; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut rewards__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = map_.next_value()?; + } + } + } + Ok(ValidatorCurrentRewardsRecord { + validator_address: validator_address__.unwrap_or_default(), + rewards: rewards__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorHistoricalRewards { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorHistoricalRewards", len)?; + if true { + struct_ser.serialize_field("cumulativeRewardRatio", &self.cumulative_reward_ratio)?; + } + if true { + struct_ser.serialize_field("referenceCount", &self.reference_count)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorHistoricalRewards { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "cumulative_reward_ratio", + "cumulativeRewardRatio", + "reference_count", + "referenceCount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CumulativeRewardRatio, + ReferenceCount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "cumulativeRewardRatio" | "cumulative_reward_ratio" => Ok(GeneratedField::CumulativeRewardRatio), + "referenceCount" | "reference_count" => Ok(GeneratedField::ReferenceCount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorHistoricalRewards; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorHistoricalRewards") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut cumulative_reward_ratio__ = None; + let mut reference_count__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CumulativeRewardRatio => { + if cumulative_reward_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field("cumulativeRewardRatio")); + } + cumulative_reward_ratio__ = Some(map_.next_value()?); + } + GeneratedField::ReferenceCount => { + if reference_count__.is_some() { + return Err(serde::de::Error::duplicate_field("referenceCount")); + } + reference_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ValidatorHistoricalRewards { + cumulative_reward_ratio: cumulative_reward_ratio__.unwrap_or_default(), + reference_count: reference_count__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorHistoricalRewards", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorHistoricalRewardsRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.distribution.v1beta1.ValidatorHistoricalRewardsRecord", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("period", ::alloc::string::ToString::to_string(&self.period).as_str())?; + } + if let Some(v) = self.rewards.as_ref() { + struct_ser.serialize_field("rewards", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorHistoricalRewardsRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "period", + "rewards", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Period, + Rewards, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "period" => Ok(GeneratedField::Period), + "rewards" => Ok(GeneratedField::Rewards), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorHistoricalRewardsRecord; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut period__ = None; + let mut rewards__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Period => { + if period__.is_some() { + return Err(serde::de::Error::duplicate_field("period")); + } + period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = map_.next_value()?; + } + } + } + Ok(ValidatorHistoricalRewardsRecord { + validator_address: validator_address__.unwrap_or_default(), + period: period__.unwrap_or_default(), + rewards: rewards__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorOutstandingRewards { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorOutstandingRewards", len)?; + if true { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorOutstandingRewards { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rewards", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rewards" => Ok(GeneratedField::Rewards), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorOutstandingRewards; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorOutstandingRewards") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rewards__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rewards => { + if rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("rewards")); + } + rewards__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorOutstandingRewards { + rewards: rewards__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorOutstandingRewards", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorOutstandingRewardsRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + struct_ser.serialize_field("outstandingRewards", &self.outstanding_rewards)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorOutstandingRewardsRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "outstanding_rewards", + "outstandingRewards", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + OutstandingRewards, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "outstandingRewards" | "outstanding_rewards" => Ok(GeneratedField::OutstandingRewards), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorOutstandingRewardsRecord; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut outstanding_rewards__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::OutstandingRewards => { + if outstanding_rewards__.is_some() { + return Err(serde::de::Error::duplicate_field("outstandingRewards")); + } + outstanding_rewards__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorOutstandingRewardsRecord { + validator_address: validator_address__.unwrap_or_default(), + outstanding_rewards: outstanding_rewards__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorSlashEvent { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEvent", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("validatorPeriod", ::alloc::string::ToString::to_string(&self.validator_period).as_str())?; + } + if true { + struct_ser.serialize_field("fraction", &self.fraction)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorSlashEvent { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_period", + "validatorPeriod", + "fraction", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorPeriod, + Fraction, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorPeriod" | "validator_period" => Ok(GeneratedField::ValidatorPeriod), + "fraction" => Ok(GeneratedField::Fraction), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorSlashEvent; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorSlashEvent") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_period__ = None; + let mut fraction__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorPeriod => { + if validator_period__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorPeriod")); + } + validator_period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Fraction => { + if fraction__.is_some() { + return Err(serde::de::Error::duplicate_field("fraction")); + } + fraction__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorSlashEvent { + validator_period: validator_period__.unwrap_or_default(), + fraction: fraction__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEvent", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorSlashEventRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.distribution.v1beta1.ValidatorSlashEventRecord", len)?; + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("period", ::alloc::string::ToString::to_string(&self.period).as_str())?; + } + if let Some(v) = self.validator_slash_event.as_ref() { + struct_ser.serialize_field("validatorSlashEvent", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorSlashEventRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_address", + "validatorAddress", + "height", + "period", + "validator_slash_event", + "validatorSlashEvent", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Height, + Period, + ValidatorSlashEvent, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "height" => Ok(GeneratedField::Height), + "period" => Ok(GeneratedField::Period), + "validatorSlashEvent" | "validator_slash_event" => Ok(GeneratedField::ValidatorSlashEvent), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorSlashEventRecord; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorSlashEventRecord") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_address__ = None; + let mut height__ = None; + let mut period__ = None; + let mut validator_slash_event__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(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::Period => { + if period__.is_some() { + return Err(serde::de::Error::duplicate_field("period")); + } + period__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ValidatorSlashEvent => { + if validator_slash_event__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSlashEvent")); + } + validator_slash_event__ = map_.next_value()?; + } + } + } + Ok(ValidatorSlashEventRecord { + validator_address: validator_address__.unwrap_or_default(), + height: height__.unwrap_or_default(), + period: period__.unwrap_or_default(), + validator_slash_event: validator_slash_event__, + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEventRecord", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorSlashEvents { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEvents", len)?; + if true { + struct_ser.serialize_field("validatorSlashEvents", &self.validator_slash_events)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorSlashEvents { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_slash_events", + "validatorSlashEvents", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorSlashEvents, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorSlashEvents" | "validator_slash_events" => Ok(GeneratedField::ValidatorSlashEvents), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorSlashEvents; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorSlashEvents") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_slash_events__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorSlashEvents => { + if validator_slash_events__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSlashEvents")); + } + validator_slash_events__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorSlashEvents { + validator_slash_events: validator_slash_events__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEvents", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs index e7afb503..88f8581b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs @@ -106,6 +106,30 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn validator_distribution_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.distribution.v1beta1.Query", + "ValidatorDistributionInfo", + )); + self.inner.unary(req, path, codec).await + } pub async fn validator_outstanding_rewards( &mut self, request: impl tonic::IntoRequest, @@ -308,6 +332,13 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn validator_distribution_info( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn validator_outstanding_rewards( &self, request: tonic::Request, @@ -473,6 +504,48 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.distribution.v1beta1.Query/ValidatorDistributionInfo" => { + #[allow(non_camel_case_types)] + struct ValidatorDistributionInfoSvc(pub Arc); + impl + tonic::server::UnaryService + for ValidatorDistributionInfoSvc + { + type Response = super::QueryValidatorDistributionInfoResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { (*inner).validator_distribution_info(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ValidatorDistributionInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/cosmos.distribution.v1beta1.Query/ValidatorOutstandingRewards" => { #[allow(non_camel_case_types)] struct ValidatorOutstandingRewardsSvc(pub Arc); @@ -1014,6 +1087,50 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.distribution.v1beta1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.distribution.v1beta1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + pub async fn community_pool_spend( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.distribution.v1beta1.Msg", + "CommunityPoolSpend", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -1046,6 +1163,14 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn community_pool_spend( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1284,6 +1409,84 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.distribution.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.distribution.v1beta1.Msg/CommunityPoolSpend" => { + #[allow(non_camel_case_types)] + struct CommunityPoolSpendSvc(pub Arc); + impl tonic::server::UnaryService + for CommunityPoolSpendSvc + { + type Response = super::MsgCommunityPoolSpendResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).community_pool_spend(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CommunityPoolSpendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.module.v1.rs new file mode 100644 index 00000000..3befc5b1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.module.v1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the config object of the evidence module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.module.v1.serde.rs new file mode 100644 index 00000000..0b7cad20 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.evidence.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs index 6ef949d0..bf82d6b6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs @@ -3,12 +3,16 @@ /// signing misbehavior. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Equivocation { + /// height is the equivocation height. #[prost(int64, tag = "1")] pub height: i64, + /// time is the equivocation time. #[prost(message, optional, tag = "2")] - pub time: ::core::option::Option<::prost_types::Timestamp>, + pub time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// power is the equivocation validator power. #[prost(int64, tag = "3")] pub power: i64, + /// consensus_address is the equivocation validator consensus address. #[prost(string, tag = "4")] pub consensus_address: ::prost::alloc::string::String, } @@ -17,21 +21,28 @@ pub struct Equivocation { pub struct GenesisState { /// evidence defines all the evidence at genesis. #[prost(message, repeated, tag = "1")] - pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub evidence: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceRequest { /// evidence_hash defines the hash of the requested evidence. + /// Deprecated: Use hash, a HEX encoded string, instead. + #[deprecated] #[prost(bytes = "vec", tag = "1")] pub evidence_hash: ::prost::alloc::vec::Vec, + /// hash defines the evidence hash of the requested evidence. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "2")] + pub hash: ::prost::alloc::string::String, } /// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceResponse { /// evidence returns the requested evidence. #[prost(message, optional, tag = "1")] - pub evidence: ::core::option::Option<::prost_types::Any>, + pub evidence: ::core::option::Option<::prost_wkt_types::Any>, } /// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC /// method. @@ -47,7 +58,7 @@ pub struct QueryAllEvidenceRequest { pub struct QueryAllEvidenceResponse { /// evidence returns all evidences. #[prost(message, repeated, tag = "1")] - pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub evidence: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, @@ -56,10 +67,12 @@ pub struct QueryAllEvidenceResponse { /// Evidence of misbehavior such as equivocation or counterfactual signing. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidence { + /// submitter is the signer account address of evidence. #[prost(string, tag = "1")] pub submitter: ::prost::alloc::string::String, + /// evidence defines the evidence of misbehavior. #[prost(message, optional, tag = "2")] - pub evidence: ::core::option::Option<::prost_types::Any>, + pub evidence: ::core::option::Option<::prost_wkt_types::Any>, } /// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.serde.rs new file mode 100644 index 00000000..72bcc804 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.serde.rs @@ -0,0 +1,844 @@ +impl serde::Serialize for Equivocation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.evidence.v1beta1.Equivocation", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.time.as_ref() { + struct_ser.serialize_field("time", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("power", ::alloc::string::ToString::to_string(&self.power).as_str())?; + } + if true { + struct_ser.serialize_field("consensusAddress", &self.consensus_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Equivocation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "time", + "power", + "consensus_address", + "consensusAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Time, + Power, + ConsensusAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "time" => Ok(GeneratedField::Time), + "power" => Ok(GeneratedField::Power), + "consensusAddress" | "consensus_address" => Ok(GeneratedField::ConsensusAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Equivocation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.Equivocation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut time__ = None; + let mut power__ = None; + let mut consensus_address__ = 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::Time => { + if time__.is_some() { + return Err(serde::de::Error::duplicate_field("time")); + } + time__ = 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) + ; + } + GeneratedField::ConsensusAddress => { + if consensus_address__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusAddress")); + } + consensus_address__ = Some(map_.next_value()?); + } + } + } + Ok(Equivocation { + height: height__.unwrap_or_default(), + time: time__, + power: power__.unwrap_or_default(), + consensus_address: consensus_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.Equivocation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.GenesisState", len)?; + if true { + struct_ser.serialize_field("evidence", &self.evidence)?; + } + 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] = &[ + "evidence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Evidence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "evidence" => Ok(GeneratedField::Evidence), + _ => 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.evidence.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut evidence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Evidence => { + if evidence__.is_some() { + return Err(serde::de::Error::duplicate_field("evidence")); + } + evidence__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + evidence: evidence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitEvidence { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.MsgSubmitEvidence", len)?; + if true { + struct_ser.serialize_field("submitter", &self.submitter)?; + } + if let Some(v) = self.evidence.as_ref() { + struct_ser.serialize_field("evidence", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitEvidence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "submitter", + "evidence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Submitter, + Evidence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "submitter" => Ok(GeneratedField::Submitter), + "evidence" => Ok(GeneratedField::Evidence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitEvidence; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.MsgSubmitEvidence") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut submitter__ = None; + let mut evidence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Submitter => { + if submitter__.is_some() { + return Err(serde::de::Error::duplicate_field("submitter")); + } + submitter__ = Some(map_.next_value()?); + } + GeneratedField::Evidence => { + if evidence__.is_some() { + return Err(serde::de::Error::duplicate_field("evidence")); + } + evidence__ = map_.next_value()?; + } + } + } + Ok(MsgSubmitEvidence { + submitter: submitter__.unwrap_or_default(), + evidence: evidence__, + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.MsgSubmitEvidence", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitEvidenceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitEvidenceResponse { + #[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 = MsgSubmitEvidenceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse") + } + + 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(MsgSubmitEvidenceResponse { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllEvidenceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.QueryAllEvidenceRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllEvidenceRequest { + #[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 = QueryAllEvidenceRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryAllEvidenceRequest") + } + + 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(QueryAllEvidenceRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.QueryAllEvidenceRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllEvidenceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.QueryAllEvidenceResponse", len)?; + if true { + struct_ser.serialize_field("evidence", &self.evidence)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllEvidenceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "evidence", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Evidence, + 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 { + "evidence" => Ok(GeneratedField::Evidence), + "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 = QueryAllEvidenceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryAllEvidenceResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut evidence__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Evidence => { + if evidence__.is_some() { + return Err(serde::de::Error::duplicate_field("evidence")); + } + evidence__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllEvidenceResponse { + evidence: evidence__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.QueryAllEvidenceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryEvidenceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.QueryEvidenceRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("evidenceHash", pbjson::private::base64::encode(&self.evidence_hash).as_str())?; + } + if true { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryEvidenceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "evidence_hash", + "evidenceHash", + "hash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EvidenceHash, + 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 { + "evidenceHash" | "evidence_hash" => Ok(GeneratedField::EvidenceHash), + "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 = QueryEvidenceRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryEvidenceRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut evidence_hash__ = None; + let mut hash__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EvidenceHash => { + if evidence_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("evidenceHash")); + } + evidence_hash__ = + 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()?); + } + } + } + Ok(QueryEvidenceRequest { + evidence_hash: evidence_hash__.unwrap_or_default(), + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.QueryEvidenceRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryEvidenceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.evidence.v1beta1.QueryEvidenceResponse", len)?; + if let Some(v) = self.evidence.as_ref() { + struct_ser.serialize_field("evidence", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryEvidenceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "evidence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Evidence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "evidence" => Ok(GeneratedField::Evidence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryEvidenceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryEvidenceResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut evidence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Evidence => { + if evidence__.is_some() { + return Err(serde::de::Error::duplicate_field("evidence")); + } + evidence__ = map_.next_value()?; + } + } + } + Ok(QueryEvidenceResponse { + evidence: evidence__, + }) + } + } + deserializer.deserialize_struct("cosmos.evidence.v1beta1.QueryEvidenceResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.module.v1.rs new file mode 100644 index 00000000..9179ac00 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.module.v1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the config object of the feegrant module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.module.v1.serde.rs new file mode 100644 index 00000000..0264fb2e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.feegrant.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs index 6715da41..e1c81728 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs @@ -10,7 +10,7 @@ pub struct BasicAllowance { pub spend_limit: ::prost::alloc::vec::Vec, /// expiration specifies an optional time when this allowance expires #[prost(message, optional, tag = "2")] - pub expiration: ::core::option::Option<::prost_types::Timestamp>, + pub expiration: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// PeriodicAllowance extends Allowance to allow for both a maximum cap, /// as well as a limit per time period. @@ -22,7 +22,7 @@ pub struct PeriodicAllowance { /// period specifies the time duration in which period_spend_limit coins can /// be spent before that allowance is reset #[prost(message, optional, tag = "2")] - pub period: ::core::option::Option<::prost_types::Duration>, + pub period: ::core::option::Option<::prost_wkt_types::Duration>, /// period_spend_limit specifies the maximum number of coins that can be spent /// in the period #[prost(message, repeated, tag = "3")] @@ -34,14 +34,14 @@ pub struct PeriodicAllowance { /// it is calculated from the start time of the first transaction after the /// last period ended #[prost(message, optional, tag = "5")] - pub period_reset: ::core::option::Option<::prost_types::Timestamp>, + pub period_reset: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// AllowedMsgAllowance creates allowance only for specified message types. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AllowedMsgAllowance { /// allowance can be any of basic and periodic fee allowance. #[prost(message, optional, tag = "1")] - pub allowance: ::core::option::Option<::prost_types::Any>, + pub allowance: ::core::option::Option<::prost_wkt_types::Any>, /// allowed_messages are the messages for which the grantee has the access. #[prost(string, repeated, tag = "2")] pub allowed_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, @@ -57,7 +57,7 @@ pub struct Grant { pub grantee: ::prost::alloc::string::String, /// allowance can be any of basic, periodic, allowed fee allowance. #[prost(message, optional, tag = "3")] - pub allowance: ::core::option::Option<::prost_types::Any>, + pub allowance: ::core::option::Option<::prost_wkt_types::Any>, } /// GenesisState contains a set of fee allowances, persisted from the store #[derive(Clone, PartialEq, ::prost::Message)] @@ -136,7 +136,7 @@ pub struct MsgGrantAllowance { pub grantee: ::prost::alloc::string::String, /// allowance can be any of basic, periodic, allowed fee allowance. #[prost(message, optional, tag = "3")] - pub allowance: ::core::option::Option<::prost_types::Any>, + pub allowance: ::core::option::Option<::prost_wkt_types::Any>, } /// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs new file mode 100644 index 00000000..ddcffb03 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs @@ -0,0 +1,1602 @@ +impl serde::Serialize for AllowedMsgAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.AllowedMsgAllowance", len)?; + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + if true { + struct_ser.serialize_field("allowedMessages", &self.allowed_messages)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AllowedMsgAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allowance", + "allowed_messages", + "allowedMessages", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowance, + AllowedMessages, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "allowance" => Ok(GeneratedField::Allowance), + "allowedMessages" | "allowed_messages" => Ok(GeneratedField::AllowedMessages), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AllowedMsgAllowance; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.AllowedMsgAllowance") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowance__ = None; + let mut allowed_messages__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Allowance => { + if allowance__.is_some() { + return Err(serde::de::Error::duplicate_field("allowance")); + } + allowance__ = map_.next_value()?; + } + GeneratedField::AllowedMessages => { + if allowed_messages__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedMessages")); + } + allowed_messages__ = Some(map_.next_value()?); + } + } + } + Ok(AllowedMsgAllowance { + allowance: allowance__, + allowed_messages: allowed_messages__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.AllowedMsgAllowance", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for BasicAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.BasicAllowance", len)?; + if true { + struct_ser.serialize_field("spendLimit", &self.spend_limit)?; + } + if let Some(v) = self.expiration.as_ref() { + struct_ser.serialize_field("expiration", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for BasicAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "spend_limit", + "spendLimit", + "expiration", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SpendLimit, + Expiration, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "expiration" => Ok(GeneratedField::Expiration), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BasicAllowance; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.BasicAllowance") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut spend_limit__ = None; + let mut expiration__ = 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::Expiration => { + if expiration__.is_some() { + return Err(serde::de::Error::duplicate_field("expiration")); + } + expiration__ = map_.next_value()?; + } + } + } + Ok(BasicAllowance { + spend_limit: spend_limit__.unwrap_or_default(), + expiration: expiration__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.BasicAllowance", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.GenesisState", len)?; + if true { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + 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] = &[ + "allowances", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "allowances" => Ok(GeneratedField::Allowances), + _ => 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.feegrant.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowances__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Allowances => { + if allowances__.is_some() { + return Err(serde::de::Error::duplicate_field("allowances")); + } + allowances__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + allowances: allowances__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Grant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.feegrant.v1beta1.Grant", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Grant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + "allowance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Allowance, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "allowance" => Ok(GeneratedField::Allowance), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Grant; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.Grant") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut allowance__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Allowance => { + if allowance__.is_some() { + return Err(serde::de::Error::duplicate_field("allowance")); + } + allowance__ = map_.next_value()?; + } + } + } + Ok(Grant { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + allowance: allowance__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.Grant", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgGrantAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.feegrant.v1beta1.MsgGrantAllowance", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgGrantAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + "allowance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Allowance, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "allowance" => Ok(GeneratedField::Allowance), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgGrantAllowance; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgGrantAllowance") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut allowance__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Allowance => { + if allowance__.is_some() { + return Err(serde::de::Error::duplicate_field("allowance")); + } + allowance__ = map_.next_value()?; + } + } + } + Ok(MsgGrantAllowance { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + allowance: allowance__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.MsgGrantAllowance", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgGrantAllowanceResponse { + #[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.feegrant.v1beta1.MsgGrantAllowanceResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgGrantAllowanceResponse { + #[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 = MsgGrantAllowanceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse") + } + + 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(MsgGrantAllowanceResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRevokeAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.MsgRevokeAllowance", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRevokeAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRevokeAllowance; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgRevokeAllowance") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + } + } + Ok(MsgRevokeAllowance { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.MsgRevokeAllowance", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRevokeAllowanceResponse { + #[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.feegrant.v1beta1.MsgRevokeAllowanceResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRevokeAllowanceResponse { + #[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 = MsgRevokeAllowanceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse") + } + + 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(MsgRevokeAllowanceResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PeriodicAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.feegrant.v1beta1.PeriodicAllowance", len)?; + if let Some(v) = self.basic.as_ref() { + struct_ser.serialize_field("basic", v)?; + } + if let Some(v) = self.period.as_ref() { + struct_ser.serialize_field("period", v)?; + } + if true { + struct_ser.serialize_field("periodSpendLimit", &self.period_spend_limit)?; + } + if true { + struct_ser.serialize_field("periodCanSpend", &self.period_can_spend)?; + } + if let Some(v) = self.period_reset.as_ref() { + struct_ser.serialize_field("periodReset", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PeriodicAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "basic", + "period", + "period_spend_limit", + "periodSpendLimit", + "period_can_spend", + "periodCanSpend", + "period_reset", + "periodReset", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Basic, + Period, + PeriodSpendLimit, + PeriodCanSpend, + PeriodReset, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "basic" => Ok(GeneratedField::Basic), + "period" => Ok(GeneratedField::Period), + "periodSpendLimit" | "period_spend_limit" => Ok(GeneratedField::PeriodSpendLimit), + "periodCanSpend" | "period_can_spend" => Ok(GeneratedField::PeriodCanSpend), + "periodReset" | "period_reset" => Ok(GeneratedField::PeriodReset), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PeriodicAllowance; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.PeriodicAllowance") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut basic__ = None; + let mut period__ = None; + let mut period_spend_limit__ = None; + let mut period_can_spend__ = None; + let mut period_reset__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Basic => { + if basic__.is_some() { + return Err(serde::de::Error::duplicate_field("basic")); + } + basic__ = map_.next_value()?; + } + GeneratedField::Period => { + if period__.is_some() { + return Err(serde::de::Error::duplicate_field("period")); + } + period__ = map_.next_value()?; + } + GeneratedField::PeriodSpendLimit => { + if period_spend_limit__.is_some() { + return Err(serde::de::Error::duplicate_field("periodSpendLimit")); + } + period_spend_limit__ = Some(map_.next_value()?); + } + GeneratedField::PeriodCanSpend => { + if period_can_spend__.is_some() { + return Err(serde::de::Error::duplicate_field("periodCanSpend")); + } + period_can_spend__ = Some(map_.next_value()?); + } + GeneratedField::PeriodReset => { + if period_reset__.is_some() { + return Err(serde::de::Error::duplicate_field("periodReset")); + } + period_reset__ = map_.next_value()?; + } + } + } + Ok(PeriodicAllowance { + basic: basic__, + period: period__, + period_spend_limit: period_spend_limit__.unwrap_or_default(), + period_can_spend: period_can_spend__.unwrap_or_default(), + period_reset: period_reset__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.PeriodicAllowance", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllowanceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowanceRequest", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllowanceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "grantee", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAllowanceRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowanceRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAllowanceRequest { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.QueryAllowanceRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllowanceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowanceResponse", len)?; + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllowanceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allowance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowance, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "allowance" => Ok(GeneratedField::Allowance), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAllowanceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowanceResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowance__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Allowance => { + if allowance__.is_some() { + return Err(serde::de::Error::duplicate_field("allowance")); + } + allowance__ = map_.next_value()?; + } + } + } + Ok(QueryAllowanceResponse { + allowance: allowance__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.QueryAllowanceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllowancesByGranterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", len)?; + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllowancesByGranterRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "granter", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + 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 { + "granter" => Ok(GeneratedField::Granter), + "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 = QueryAllowancesByGranterRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllowancesByGranterRequest { + granter: granter__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllowancesByGranterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", len)?; + if true { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllowancesByGranterResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allowances", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + 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 { + "allowances" => Ok(GeneratedField::Allowances), + "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 = QueryAllowancesByGranterResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowances__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Allowances => { + if allowances__.is_some() { + return Err(serde::de::Error::duplicate_field("allowances")); + } + allowances__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllowancesByGranterResponse { + allowances: allowances__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllowancesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesRequest", len)?; + if true { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllowancesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "grantee", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grantee, + 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 { + "grantee" => Ok(GeneratedField::Grantee), + "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 = QueryAllowancesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut grantee__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllowancesRequest { + grantee: grantee__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllowancesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesResponse", len)?; + if true { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllowancesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allowances", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + 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 { + "allowances" => Ok(GeneratedField::Allowances), + "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 = QueryAllowancesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowances__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Allowances => { + if allowances__.is_some() { + return Err(serde::de::Error::duplicate_field("allowances")); + } + allowances__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllowancesResponse { + allowances: allowances__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.module.v1.rs new file mode 100644 index 00000000..64e36f04 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.module.v1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the config object for the genutil module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.module.v1.serde.rs new file mode 100644 index 00000000..94672879 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.genutil.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.genutil.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.genutil.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.serde.rs new file mode 100644 index 00000000..492036e8 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.serde.rs @@ -0,0 +1,95 @@ +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.genutil.v1beta1.GenesisState", len)?; + if true { + struct_ser.serialize_field("genTxs", &self.gen_txs.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + 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] = &[ + "gen_txs", + "genTxs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GenTxs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "genTxs" | "gen_txs" => Ok(GeneratedField::GenTxs), + _ => 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.genutil.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut gen_txs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GenTxs => { + if gen_txs__.is_some() { + return Err(serde::de::Error::duplicate_field("genTxs")); + } + gen_txs__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(GenesisState { + gen_txs: gen_txs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.genutil.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.module.v1.rs new file mode 100644 index 00000000..af9a4403 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.module.v1.rs @@ -0,0 +1,13 @@ +// @generated +/// Module is the config object of the gov module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// max_metadata_len defines the maximum proposal metadata length. + /// Defaults to 255 if not explicitly set. + #[prost(uint64, tag = "1")] + pub max_metadata_len: u64, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.module.v1.serde.rs new file mode 100644 index 00000000..88377721 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.module.v1.serde.rs @@ -0,0 +1,112 @@ +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.module.v1.Module", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("maxMetadataLen", ::alloc::string::ToString::to_string(&self.max_metadata_len).as_str())?; + } + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "max_metadata_len", + "maxMetadataLen", + "authority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MaxMetadataLen, + Authority, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "maxMetadataLen" | "max_metadata_len" => Ok(GeneratedField::MaxMetadataLen), + "authority" => Ok(GeneratedField::Authority), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut max_metadata_len__ = None; + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MaxMetadataLen => { + if max_metadata_len__.is_some() { + return Err(serde::de::Error::duplicate_field("maxMetadataLen")); + } + max_metadata_len__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + } + } + Ok(Module { + max_metadata_len: max_metadata_len__.unwrap_or_default(), + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs index 97baf541..55f36b50 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs @@ -2,8 +2,10 @@ /// WeightedVoteOption defines a unit of vote for vote split. #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { + /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] pub option: i32, + /// weight is the vote weight associated with the vote option. #[prost(string, tag = "2")] pub weight: ::prost::alloc::string::String, } @@ -11,20 +13,26 @@ pub struct WeightedVoteOption { /// proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// Proposal defines the core field members of a governance proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { + /// id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub id: u64, + /// messages are the arbitrary messages to be executed if the proposal passes. #[prost(message, repeated, tag = "2")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, + /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] pub status: i32, /// final_tally_result is the final tally result of the proposal. When @@ -32,29 +40,53 @@ pub struct Proposal { /// proposal's voting period has ended. #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, + /// submit_time is the time of proposal submission. #[prost(message, optional, tag = "5")] - pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + pub submit_time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// deposit_end_time is the end time for deposition. #[prost(message, optional, tag = "6")] - pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub deposit_end_time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// total_deposit is the total deposit on the proposal. #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, + /// voting_start_time is the starting time to vote on a proposal. #[prost(message, optional, tag = "8")] - pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_start_time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// voting_end_time is the end time of voting on a proposal. #[prost(message, optional, tag = "9")] - pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_end_time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, + /// title is the title of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "11")] + pub title: ::prost::alloc::string::String, + /// summary is a short summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "12")] + pub summary: ::prost::alloc::string::String, + /// Proposer is the address of the proposal sumbitter + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "13")] + pub proposer: ::prost::alloc::string::String, } /// TallyResult defines a standard tally for a governance proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { + /// yes_count is the number of yes votes on a proposal. #[prost(string, tag = "1")] pub yes_count: ::prost::alloc::string::String, + /// abstain_count is the number of abstain votes on a proposal. #[prost(string, tag = "2")] pub abstain_count: ::prost::alloc::string::String, + /// no_count is the number of no votes on a proposal. #[prost(string, tag = "3")] pub no_count: ::prost::alloc::string::String, + /// no_with_veto_count is the number of no with veto votes on a proposal. #[prost(string, tag = "4")] pub no_with_veto_count: ::prost::alloc::string::String, } @@ -62,10 +94,13 @@ pub struct TallyResult { /// A Vote consists of a proposal ID, the voter, and the vote option. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// voter is the voter address of the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// options is the weighted vote options. #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, /// metadata is any arbitrary metadata to attached to the vote. @@ -75,35 +110,74 @@ pub struct Vote { /// DepositParams defines the params for deposits on governance proposals. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { - /// Minimum deposit for a proposal to enter voting period. + /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, - /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - /// months. + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. #[prost(message, optional, tag = "2")] - pub max_deposit_period: ::core::option::Option<::prost_types::Duration>, + pub max_deposit_period: ::core::option::Option<::prost_wkt_types::Duration>, } /// VotingParams defines the params for voting on governance proposals. #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { - /// Length of the voting period. + /// Duration of the voting period. #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option<::prost_types::Duration>, + pub voting_period: ::core::option::Option<::prost_wkt_types::Duration>, } /// TallyParams defines the params for tallying votes on governance proposals. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. + #[prost(string, tag = "1")] + pub quorum: ::prost::alloc::string::String, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + #[prost(string, tag = "2")] + pub threshold: ::prost::alloc::string::String, + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. + #[prost(string, tag = "3")] + pub veto_threshold: ::prost::alloc::string::String, +} +/// Params defines the parameters for the x/gov module. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Minimum deposit for a proposal to enter voting period. + #[prost(message, repeated, tag = "1")] + pub min_deposit: ::prost::alloc::vec::Vec, + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. + #[prost(message, optional, tag = "2")] + pub max_deposit_period: ::core::option::Option<::prost_wkt_types::Duration>, + /// Duration of the voting period. + #[prost(message, optional, tag = "3")] + pub voting_period: ::core::option::Option<::prost_wkt_types::Duration>, /// Minimum percentage of total stake needed to vote for a result to be /// considered valid. - #[prost(string, tag = "1")] + #[prost(string, tag = "4")] pub quorum: ::prost::alloc::string::String, /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - #[prost(string, tag = "2")] + #[prost(string, tag = "5")] pub threshold: ::prost::alloc::string::String, /// Minimum value of Veto votes to Total votes ratio for proposal to be /// vetoed. Default value: 1/3. - #[prost(string, tag = "3")] + #[prost(string, tag = "6")] pub veto_threshold: ::prost::alloc::string::String, + /// The ratio representing the proportion of the deposit value that must be paid at proposal submission. + #[prost(string, tag = "7")] + pub min_initial_deposit_ratio: ::prost::alloc::string::String, + /// burn deposits if a proposal does not meet quorum + #[prost(bool, tag = "13")] + pub burn_vote_quorum: bool, + /// burn deposits if the proposal does not enter voting period + #[prost(bool, tag = "14")] + pub burn_proposal_deposit_prevote: bool, + /// burn deposits if quorum with vote type no_veto is met + #[prost(bool, tag = "15")] + pub burn_vote_veto: bool, } /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -188,15 +262,26 @@ pub struct GenesisState { /// proposals defines all the proposals present at genesis. #[prost(message, repeated, tag = "4")] pub proposals: ::prost::alloc::vec::Vec, - /// params defines all the paramaters of related to deposit. + /// Deprecated: Prefer to use `params` instead. + /// deposit_params defines all the paramaters of related to deposit. + #[deprecated] #[prost(message, optional, tag = "5")] pub deposit_params: ::core::option::Option, - /// params defines all the paramaters of related to voting. + /// Deprecated: Prefer to use `params` instead. + /// voting_params defines all the paramaters of related to voting. + #[deprecated] #[prost(message, optional, tag = "6")] pub voting_params: ::core::option::Option, - /// params defines all the paramaters of related to tally. + /// Deprecated: Prefer to use `params` instead. + /// tally_params defines all the paramaters of related to tally. + #[deprecated] #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, + /// params defines all the paramaters of x/gov module. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "8")] + pub params: ::core::option::Option, } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -208,6 +293,7 @@ pub struct QueryProposalRequest { /// QueryProposalResponse is the response type for the Query/Proposal RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { + /// proposal is the requested governance proposal. #[prost(message, optional, tag = "1")] pub proposal: ::core::option::Option, } @@ -231,6 +317,7 @@ pub struct QueryProposalsRequest { /// method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { + /// proposals defines all the requested governance proposals. #[prost(message, repeated, tag = "1")] pub proposals: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -250,7 +337,7 @@ pub struct QueryVoteRequest { /// QueryVoteResponse is the response type for the Query/Vote RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { - /// vote defined the queried vote. + /// vote defines the queried vote. #[prost(message, optional, tag = "1")] pub vote: ::core::option::Option, } @@ -267,7 +354,7 @@ pub struct QueryVotesRequest { /// QueryVotesResponse is the response type for the Query/Votes RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { - /// votes defined the queried votes. + /// votes defines the queried votes. #[prost(message, repeated, tag = "1")] pub votes: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -285,15 +372,26 @@ pub struct QueryParamsRequest { /// QueryParamsResponse is the response type for the Query/Params RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { + /// Deprecated: Prefer to use `params` instead. /// voting_params defines the parameters related to voting. + #[deprecated] #[prost(message, optional, tag = "1")] pub voting_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. /// deposit_params defines the parameters related to deposit. + #[deprecated] #[prost(message, optional, tag = "2")] pub deposit_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. /// tally_params defines the parameters related to tally. + #[deprecated] #[prost(message, optional, tag = "3")] pub tally_params: ::core::option::Option, + /// params defines all the paramaters of x/gov module. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -325,6 +423,7 @@ pub struct QueryDepositsRequest { /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { + /// deposits defines the requested deposits. #[prost(message, repeated, tag = "1")] pub deposits: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -349,19 +448,33 @@ pub struct QueryTallyResultResponse { /// proposal Content. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { + /// messages are the arbitrary messages to be executed if proposal passes. #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, + /// initial_deposit is the deposit value that must be paid at proposal submission. #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, + /// proposer is the account address of the proposer. #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, + /// title is the title of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "5")] + pub title: ::prost::alloc::string::String, + /// summary is the summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "6")] + pub summary: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, } @@ -371,7 +484,7 @@ pub struct MsgSubmitProposalResponse { pub struct MsgExecLegacyContent { /// content is the proposal's content. #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option<::prost_types::Any>, + pub content: ::core::option::Option<::prost_wkt_types::Any>, /// authority must be the gov module address. #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, @@ -382,12 +495,16 @@ pub struct MsgExecLegacyContentResponse {} /// MsgVote defines a message to cast a vote. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, + /// metadata is any arbitrary metadata attached to the Vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, } @@ -397,12 +514,16 @@ pub struct MsgVoteResponse {} /// MsgVoteWeighted defines a message to cast a vote. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// options defines the weighted vote options. #[prost(message, repeated, tag = "3")] pub options: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata attached to the VoteWeighted. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, } @@ -412,15 +533,38 @@ pub struct MsgVoteWeightedResponse {} /// MsgDeposit defines a message to submit a deposit to an existing proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// MsgDepositResponse defines the Msg/Deposit response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/gov parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("cosmos.gov.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs new file mode 100644 index 00000000..82932543 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs @@ -0,0 +1,4771 @@ +impl serde::Serialize for Deposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Deposit", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Deposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "depositor", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "depositor" => Ok(GeneratedField::Depositor), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Deposit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Deposit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut depositor__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(Deposit { + proposal_id: proposal_id__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.Deposit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DepositParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.DepositParams", len)?; + if true { + struct_ser.serialize_field("minDeposit", &self.min_deposit)?; + } + if let Some(v) = self.max_deposit_period.as_ref() { + struct_ser.serialize_field("maxDepositPeriod", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DepositParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "min_deposit", + "minDeposit", + "max_deposit_period", + "maxDepositPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MinDeposit, + MaxDepositPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "minDeposit" | "min_deposit" => Ok(GeneratedField::MinDeposit), + "maxDepositPeriod" | "max_deposit_period" => Ok(GeneratedField::MaxDepositPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DepositParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.DepositParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut min_deposit__ = None; + let mut max_deposit_period__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MinDeposit => { + if min_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("minDeposit")); + } + min_deposit__ = Some(map_.next_value()?); + } + GeneratedField::MaxDepositPeriod => { + if max_deposit_period__.is_some() { + return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); + } + max_deposit_period__ = map_.next_value()?; + } + } + } + Ok(DepositParams { + min_deposit: min_deposit__.unwrap_or_default(), + max_deposit_period: max_deposit_period__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.DepositParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.GenesisState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startingProposalId", ::alloc::string::ToString::to_string(&self.starting_proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if true { + struct_ser.serialize_field("votes", &self.votes)?; + } + if true { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.deposit_params.as_ref() { + struct_ser.serialize_field("depositParams", v)?; + } + if let Some(v) = self.voting_params.as_ref() { + struct_ser.serialize_field("votingParams", v)?; + } + if let Some(v) = self.tally_params.as_ref() { + struct_ser.serialize_field("tallyParams", v)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "starting_proposal_id", + "startingProposalId", + "deposits", + "votes", + "proposals", + "deposit_params", + "depositParams", + "voting_params", + "votingParams", + "tally_params", + "tallyParams", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + StartingProposalId, + Deposits, + Votes, + Proposals, + DepositParams, + VotingParams, + TallyParams, + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "startingProposalId" | "starting_proposal_id" => Ok(GeneratedField::StartingProposalId), + "deposits" => Ok(GeneratedField::Deposits), + "votes" => Ok(GeneratedField::Votes), + "proposals" => Ok(GeneratedField::Proposals), + "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), + "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), + "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut starting_proposal_id__ = None; + let mut deposits__ = None; + let mut votes__ = None; + let mut proposals__ = None; + let mut deposit_params__ = None; + let mut voting_params__ = None; + let mut tally_params__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::StartingProposalId => { + if starting_proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("startingProposalId")); + } + starting_proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Deposits => { + if deposits__.is_some() { + return Err(serde::de::Error::duplicate_field("deposits")); + } + deposits__ = Some(map_.next_value()?); + } + GeneratedField::Votes => { + if votes__.is_some() { + return Err(serde::de::Error::duplicate_field("votes")); + } + votes__ = Some(map_.next_value()?); + } + GeneratedField::Proposals => { + if proposals__.is_some() { + return Err(serde::de::Error::duplicate_field("proposals")); + } + proposals__ = Some(map_.next_value()?); + } + GeneratedField::DepositParams => { + if deposit_params__.is_some() { + return Err(serde::de::Error::duplicate_field("depositParams")); + } + deposit_params__ = map_.next_value()?; + } + GeneratedField::VotingParams => { + if voting_params__.is_some() { + return Err(serde::de::Error::duplicate_field("votingParams")); + } + voting_params__ = map_.next_value()?; + } + GeneratedField::TallyParams => { + if tally_params__.is_some() { + return Err(serde::de::Error::duplicate_field("tallyParams")); + } + tally_params__ = map_.next_value()?; + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + starting_proposal_id: starting_proposal_id__.unwrap_or_default(), + deposits: deposits__.unwrap_or_default(), + votes: votes__.unwrap_or_default(), + proposals: proposals__.unwrap_or_default(), + deposit_params: deposit_params__, + voting_params: voting_params__, + tally_params: tally_params__, + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgDeposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgDeposit", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgDeposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "depositor", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "depositor" => Ok(GeneratedField::Depositor), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDeposit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgDeposit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut depositor__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(MsgDeposit { + proposal_id: proposal_id__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgDeposit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgDepositResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDepositResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgDepositResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgDepositResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgDepositResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExecLegacyContent { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgExecLegacyContent", len)?; + if let Some(v) = self.content.as_ref() { + struct_ser.serialize_field("content", v)?; + } + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExecLegacyContent { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "content", + "authority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Content, + Authority, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "content" => Ok(GeneratedField::Content), + "authority" => Ok(GeneratedField::Authority), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgExecLegacyContent; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgExecLegacyContent") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut content__ = None; + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Content => { + if content__.is_some() { + return Err(serde::de::Error::duplicate_field("content")); + } + content__ = map_.next_value()?; + } + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + } + } + Ok(MsgExecLegacyContent { + content: content__, + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgExecLegacyContent", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExecLegacyContentResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgExecLegacyContentResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExecLegacyContentResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgExecLegacyContentResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgExecLegacyContentResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgExecLegacyContentResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgExecLegacyContentResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposal", len)?; + if true { + struct_ser.serialize_field("messages", &self.messages)?; + } + if true { + struct_ser.serialize_field("initialDeposit", &self.initial_deposit)?; + } + if true { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + struct_ser.serialize_field("title", &self.title)?; + } + if true { + struct_ser.serialize_field("summary", &self.summary)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "messages", + "initial_deposit", + "initialDeposit", + "proposer", + "metadata", + "title", + "summary", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Messages, + InitialDeposit, + Proposer, + Metadata, + Title, + Summary, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "messages" => Ok(GeneratedField::Messages), + "initialDeposit" | "initial_deposit" => Ok(GeneratedField::InitialDeposit), + "proposer" => Ok(GeneratedField::Proposer), + "metadata" => Ok(GeneratedField::Metadata), + "title" => Ok(GeneratedField::Title), + "summary" => Ok(GeneratedField::Summary), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut messages__ = None; + let mut initial_deposit__ = None; + let mut proposer__ = None; + let mut metadata__ = None; + let mut title__ = None; + let mut summary__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Messages => { + if messages__.is_some() { + return Err(serde::de::Error::duplicate_field("messages")); + } + messages__ = Some(map_.next_value()?); + } + GeneratedField::InitialDeposit => { + if initial_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("initialDeposit")); + } + initial_deposit__ = Some(map_.next_value()?); + } + GeneratedField::Proposer => { + if proposer__.is_some() { + return Err(serde::de::Error::duplicate_field("proposer")); + } + proposer__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Title => { + if title__.is_some() { + return Err(serde::de::Error::duplicate_field("title")); + } + title__ = Some(map_.next_value()?); + } + GeneratedField::Summary => { + if summary__.is_some() { + return Err(serde::de::Error::duplicate_field("summary")); + } + summary__ = Some(map_.next_value()?); + } + } + } + Ok(MsgSubmitProposal { + messages: messages__.unwrap_or_default(), + initial_deposit: initial_deposit__.unwrap_or_default(), + proposer: proposer__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + title: title__.unwrap_or_default(), + summary: summary__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgSubmitProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposalResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgSubmitProposalResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgSubmitProposalResponse { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgSubmitProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authority", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgUpdateParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgUpdateParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + "option", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Option, + Metadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + "option" => Ok(GeneratedField::Option), + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVote; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVote") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + let mut option__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Option => { + if option__.is_some() { + return Err(serde::de::Error::duplicate_field("option")); + } + option__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(MsgVote { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + option: option__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgVote", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVoteResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVoteResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgVoteResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgVoteResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVoteWeighted { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteWeighted", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + struct_ser.serialize_field("options", &self.options)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVoteWeighted { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + "options", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Options, + Metadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + "options" => Ok(GeneratedField::Options), + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVoteWeighted; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVoteWeighted") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + let mut options__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(MsgVoteWeighted { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + options: options__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgVoteWeighted", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteWeightedResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVoteWeightedResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVoteWeightedResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgVoteWeightedResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgVoteWeightedResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Params", len)?; + if true { + struct_ser.serialize_field("minDeposit", &self.min_deposit)?; + } + if let Some(v) = self.max_deposit_period.as_ref() { + struct_ser.serialize_field("maxDepositPeriod", v)?; + } + if let Some(v) = self.voting_period.as_ref() { + struct_ser.serialize_field("votingPeriod", v)?; + } + if true { + struct_ser.serialize_field("quorum", &self.quorum)?; + } + if true { + struct_ser.serialize_field("threshold", &self.threshold)?; + } + if true { + struct_ser.serialize_field("vetoThreshold", &self.veto_threshold)?; + } + if true { + struct_ser.serialize_field("minInitialDepositRatio", &self.min_initial_deposit_ratio)?; + } + if true { + struct_ser.serialize_field("burnVoteQuorum", &self.burn_vote_quorum)?; + } + if true { + struct_ser.serialize_field("burnProposalDepositPrevote", &self.burn_proposal_deposit_prevote)?; + } + if true { + struct_ser.serialize_field("burnVoteVeto", &self.burn_vote_veto)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "min_deposit", + "minDeposit", + "max_deposit_period", + "maxDepositPeriod", + "voting_period", + "votingPeriod", + "quorum", + "threshold", + "veto_threshold", + "vetoThreshold", + "min_initial_deposit_ratio", + "minInitialDepositRatio", + "burn_vote_quorum", + "burnVoteQuorum", + "burn_proposal_deposit_prevote", + "burnProposalDepositPrevote", + "burn_vote_veto", + "burnVoteVeto", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MinDeposit, + MaxDepositPeriod, + VotingPeriod, + Quorum, + Threshold, + VetoThreshold, + MinInitialDepositRatio, + BurnVoteQuorum, + BurnProposalDepositPrevote, + BurnVoteVeto, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "minDeposit" | "min_deposit" => Ok(GeneratedField::MinDeposit), + "maxDepositPeriod" | "max_deposit_period" => Ok(GeneratedField::MaxDepositPeriod), + "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), + "quorum" => Ok(GeneratedField::Quorum), + "threshold" => Ok(GeneratedField::Threshold), + "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), + "minInitialDepositRatio" | "min_initial_deposit_ratio" => Ok(GeneratedField::MinInitialDepositRatio), + "burnVoteQuorum" | "burn_vote_quorum" => Ok(GeneratedField::BurnVoteQuorum), + "burnProposalDepositPrevote" | "burn_proposal_deposit_prevote" => Ok(GeneratedField::BurnProposalDepositPrevote), + "burnVoteVeto" | "burn_vote_veto" => Ok(GeneratedField::BurnVoteVeto), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Params; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut min_deposit__ = None; + let mut max_deposit_period__ = None; + let mut voting_period__ = None; + let mut quorum__ = None; + let mut threshold__ = None; + let mut veto_threshold__ = None; + let mut min_initial_deposit_ratio__ = None; + let mut burn_vote_quorum__ = None; + let mut burn_proposal_deposit_prevote__ = None; + let mut burn_vote_veto__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MinDeposit => { + if min_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("minDeposit")); + } + min_deposit__ = Some(map_.next_value()?); + } + GeneratedField::MaxDepositPeriod => { + if max_deposit_period__.is_some() { + return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); + } + max_deposit_period__ = map_.next_value()?; + } + GeneratedField::VotingPeriod => { + if voting_period__.is_some() { + return Err(serde::de::Error::duplicate_field("votingPeriod")); + } + voting_period__ = map_.next_value()?; + } + GeneratedField::Quorum => { + if quorum__.is_some() { + return Err(serde::de::Error::duplicate_field("quorum")); + } + quorum__ = Some(map_.next_value()?); + } + GeneratedField::Threshold => { + if threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("threshold")); + } + threshold__ = Some(map_.next_value()?); + } + GeneratedField::VetoThreshold => { + if veto_threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("vetoThreshold")); + } + veto_threshold__ = Some(map_.next_value()?); + } + GeneratedField::MinInitialDepositRatio => { + if min_initial_deposit_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field("minInitialDepositRatio")); + } + min_initial_deposit_ratio__ = Some(map_.next_value()?); + } + GeneratedField::BurnVoteQuorum => { + if burn_vote_quorum__.is_some() { + return Err(serde::de::Error::duplicate_field("burnVoteQuorum")); + } + burn_vote_quorum__ = Some(map_.next_value()?); + } + GeneratedField::BurnProposalDepositPrevote => { + if burn_proposal_deposit_prevote__.is_some() { + return Err(serde::de::Error::duplicate_field("burnProposalDepositPrevote")); + } + burn_proposal_deposit_prevote__ = Some(map_.next_value()?); + } + GeneratedField::BurnVoteVeto => { + if burn_vote_veto__.is_some() { + return Err(serde::de::Error::duplicate_field("burnVoteVeto")); + } + burn_vote_veto__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + min_deposit: min_deposit__.unwrap_or_default(), + max_deposit_period: max_deposit_period__, + voting_period: voting_period__, + quorum: quorum__.unwrap_or_default(), + threshold: threshold__.unwrap_or_default(), + veto_threshold: veto_threshold__.unwrap_or_default(), + min_initial_deposit_ratio: min_initial_deposit_ratio__.unwrap_or_default(), + burn_vote_quorum: burn_vote_quorum__.unwrap_or_default(), + burn_proposal_deposit_prevote: burn_proposal_deposit_prevote__.unwrap_or_default(), + burn_vote_veto: burn_vote_veto__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Proposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Proposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; + } + if true { + struct_ser.serialize_field("messages", &self.messages)?; + } + if true { + let v = ProposalStatus::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; + struct_ser.serialize_field("status", &v)?; + } + if let Some(v) = self.final_tally_result.as_ref() { + struct_ser.serialize_field("finalTallyResult", v)?; + } + if let Some(v) = self.submit_time.as_ref() { + struct_ser.serialize_field("submitTime", v)?; + } + if let Some(v) = self.deposit_end_time.as_ref() { + struct_ser.serialize_field("depositEndTime", v)?; + } + if true { + struct_ser.serialize_field("totalDeposit", &self.total_deposit)?; + } + if let Some(v) = self.voting_start_time.as_ref() { + struct_ser.serialize_field("votingStartTime", v)?; + } + if let Some(v) = self.voting_end_time.as_ref() { + struct_ser.serialize_field("votingEndTime", v)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + struct_ser.serialize_field("title", &self.title)?; + } + if true { + struct_ser.serialize_field("summary", &self.summary)?; + } + if true { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Proposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "messages", + "status", + "final_tally_result", + "finalTallyResult", + "submit_time", + "submitTime", + "deposit_end_time", + "depositEndTime", + "total_deposit", + "totalDeposit", + "voting_start_time", + "votingStartTime", + "voting_end_time", + "votingEndTime", + "metadata", + "title", + "summary", + "proposer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + Messages, + Status, + FinalTallyResult, + SubmitTime, + DepositEndTime, + TotalDeposit, + VotingStartTime, + VotingEndTime, + Metadata, + Title, + Summary, + Proposer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "id" => Ok(GeneratedField::Id), + "messages" => Ok(GeneratedField::Messages), + "status" => Ok(GeneratedField::Status), + "finalTallyResult" | "final_tally_result" => Ok(GeneratedField::FinalTallyResult), + "submitTime" | "submit_time" => Ok(GeneratedField::SubmitTime), + "depositEndTime" | "deposit_end_time" => Ok(GeneratedField::DepositEndTime), + "totalDeposit" | "total_deposit" => Ok(GeneratedField::TotalDeposit), + "votingStartTime" | "voting_start_time" => Ok(GeneratedField::VotingStartTime), + "votingEndTime" | "voting_end_time" => Ok(GeneratedField::VotingEndTime), + "metadata" => Ok(GeneratedField::Metadata), + "title" => Ok(GeneratedField::Title), + "summary" => Ok(GeneratedField::Summary), + "proposer" => Ok(GeneratedField::Proposer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Proposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Proposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut messages__ = None; + let mut status__ = None; + let mut final_tally_result__ = None; + let mut submit_time__ = None; + let mut deposit_end_time__ = None; + let mut total_deposit__ = None; + let mut voting_start_time__ = None; + let mut voting_end_time__ = None; + let mut metadata__ = None; + let mut title__ = None; + let mut summary__ = None; + let mut proposer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Messages => { + if messages__.is_some() { + return Err(serde::de::Error::duplicate_field("messages")); + } + messages__ = Some(map_.next_value()?); + } + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::FinalTallyResult => { + if final_tally_result__.is_some() { + return Err(serde::de::Error::duplicate_field("finalTallyResult")); + } + final_tally_result__ = map_.next_value()?; + } + GeneratedField::SubmitTime => { + if submit_time__.is_some() { + return Err(serde::de::Error::duplicate_field("submitTime")); + } + submit_time__ = map_.next_value()?; + } + GeneratedField::DepositEndTime => { + if deposit_end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("depositEndTime")); + } + deposit_end_time__ = map_.next_value()?; + } + GeneratedField::TotalDeposit => { + if total_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("totalDeposit")); + } + total_deposit__ = Some(map_.next_value()?); + } + GeneratedField::VotingStartTime => { + if voting_start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("votingStartTime")); + } + voting_start_time__ = map_.next_value()?; + } + GeneratedField::VotingEndTime => { + if voting_end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("votingEndTime")); + } + voting_end_time__ = map_.next_value()?; + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Title => { + if title__.is_some() { + return Err(serde::de::Error::duplicate_field("title")); + } + title__ = Some(map_.next_value()?); + } + GeneratedField::Summary => { + if summary__.is_some() { + return Err(serde::de::Error::duplicate_field("summary")); + } + summary__ = Some(map_.next_value()?); + } + GeneratedField::Proposer => { + if proposer__.is_some() { + return Err(serde::de::Error::duplicate_field("proposer")); + } + proposer__ = Some(map_.next_value()?); + } + } + } + Ok(Proposal { + id: id__.unwrap_or_default(), + messages: messages__.unwrap_or_default(), + status: status__.unwrap_or_default(), + final_tally_result: final_tally_result__, + submit_time: submit_time__, + deposit_end_time: deposit_end_time__, + total_deposit: total_deposit__.unwrap_or_default(), + voting_start_time: voting_start_time__, + voting_end_time: voting_end_time__, + metadata: metadata__.unwrap_or_default(), + title: title__.unwrap_or_default(), + summary: summary__.unwrap_or_default(), + proposer: proposer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.Proposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProposalStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + Self::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", + Self::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", + Self::Passed => "PROPOSAL_STATUS_PASSED", + Self::Rejected => "PROPOSAL_STATUS_REJECTED", + Self::Failed => "PROPOSAL_STATUS_FAILED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ProposalStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "PROPOSAL_STATUS_UNSPECIFIED", + "PROPOSAL_STATUS_DEPOSIT_PERIOD", + "PROPOSAL_STATUS_VOTING_PERIOD", + "PROPOSAL_STATUS_PASSED", + "PROPOSAL_STATUS_REJECTED", + "PROPOSAL_STATUS_FAILED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProposalStatus; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Ok(ProposalStatus::Unspecified), + "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Ok(ProposalStatus::DepositPeriod), + "PROPOSAL_STATUS_VOTING_PERIOD" => Ok(ProposalStatus::VotingPeriod), + "PROPOSAL_STATUS_PASSED" => Ok(ProposalStatus::Passed), + "PROPOSAL_STATUS_REJECTED" => Ok(ProposalStatus::Rejected), + "PROPOSAL_STATUS_FAILED" => Ok(ProposalStatus::Failed), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "depositor", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "depositor" => Ok(GeneratedField::Depositor), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut depositor__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDepositRequest { + proposal_id: proposal_id__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositResponse", len)?; + if let Some(v) = self.deposit.as_ref() { + struct_ser.serialize_field("deposit", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "deposit", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposit, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "deposit" => Ok(GeneratedField::Deposit), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut deposit__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Deposit => { + if deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("deposit")); + } + deposit__ = map_.next_value()?; + } + } + } + Ok(QueryDepositResponse { + deposit: deposit__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositsRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDepositsRequest { + proposal_id: proposal_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryDepositsResponse", len)?; + if true { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "deposits", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposits, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "deposits" => Ok(GeneratedField::Deposits), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut deposits__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Deposits => { + if deposits__.is_some() { + return Err(serde::de::Error::duplicate_field("deposits")); + } + deposits__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDepositsResponse { + deposits: deposits__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryDepositsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryParamsRequest", len)?; + if true { + struct_ser.serialize_field("paramsType", &self.params_type)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params_type", + "paramsType", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ParamsType, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "paramsType" | "params_type" => Ok(GeneratedField::ParamsType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params_type__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ParamsType => { + if params_type__.is_some() { + return Err(serde::de::Error::duplicate_field("paramsType")); + } + params_type__ = Some(map_.next_value()?); + } + } + } + Ok(QueryParamsRequest { + params_type: params_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryParamsResponse", len)?; + if let Some(v) = self.voting_params.as_ref() { + struct_ser.serialize_field("votingParams", v)?; + } + if let Some(v) = self.deposit_params.as_ref() { + struct_ser.serialize_field("depositParams", v)?; + } + if let Some(v) = self.tally_params.as_ref() { + struct_ser.serialize_field("tallyParams", v)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "voting_params", + "votingParams", + "deposit_params", + "depositParams", + "tally_params", + "tallyParams", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingParams, + DepositParams, + TallyParams, + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), + "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), + "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut voting_params__ = None; + let mut deposit_params__ = None; + let mut tally_params__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::VotingParams => { + if voting_params__.is_some() { + return Err(serde::de::Error::duplicate_field("votingParams")); + } + voting_params__ = map_.next_value()?; + } + GeneratedField::DepositParams => { + if deposit_params__.is_some() { + return Err(serde::de::Error::duplicate_field("depositParams")); + } + deposit_params__ = map_.next_value()?; + } + GeneratedField::TallyParams => { + if tally_params__.is_some() { + return Err(serde::de::Error::duplicate_field("tallyParams")); + } + tally_params__ = map_.next_value()?; + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(QueryParamsResponse { + voting_params: voting_params__, + deposit_params: deposit_params__, + tally_params: tally_params__, + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryProposalRequest { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalResponse", len)?; + if let Some(v) = self.proposal.as_ref() { + struct_ser.serialize_field("proposal", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposal, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposal" => Ok(GeneratedField::Proposal), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Proposal => { + if proposal__.is_some() { + return Err(serde::de::Error::duplicate_field("proposal")); + } + proposal__ = map_.next_value()?; + } + } + } + Ok(QueryProposalResponse { + proposal: proposal__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalsRequest", len)?; + if true { + let v = ProposalStatus::try_from(self.proposal_status) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.proposal_status)))?; + struct_ser.serialize_field("proposalStatus", &v)?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_status", + "proposalStatus", + "voter", + "depositor", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalStatus, + Voter, + Depositor, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalStatus" | "proposal_status" => Ok(GeneratedField::ProposalStatus), + "voter" => Ok(GeneratedField::Voter), + "depositor" => Ok(GeneratedField::Depositor), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_status__ = None; + let mut voter__ = None; + let mut depositor__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalStatus => { + if proposal_status__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalStatus")); + } + proposal_status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryProposalsRequest { + proposal_status: proposal_status__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryProposalsResponse", len)?; + if true { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposals", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposals, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposals" => Ok(GeneratedField::Proposals), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposals__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Proposals => { + if proposals__.is_some() { + return Err(serde::de::Error::duplicate_field("proposals")); + } + proposals__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryProposalsResponse { + proposals: proposals__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryProposalsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTallyResultRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryTallyResultRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTallyResultRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryTallyResultRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryTallyResultRequest { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryTallyResultRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTallyResultResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryTallyResultResponse", len)?; + if let Some(v) = self.tally.as_ref() { + struct_ser.serialize_field("tally", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tally", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tally, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "tally" => Ok(GeneratedField::Tally), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTallyResultResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryTallyResultResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tally__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Tally => { + if tally__.is_some() { + return Err(serde::de::Error::duplicate_field("tally")); + } + tally__ = map_.next_value()?; + } + } + } + Ok(QueryTallyResultResponse { + tally: tally__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryTallyResultResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVoteRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVoteRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVoteRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVoteRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVoteRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + } + } + Ok(QueryVoteRequest { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryVoteRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVoteResponse", len)?; + if let Some(v) = self.vote.as_ref() { + struct_ser.serialize_field("vote", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "vote", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Vote, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "vote" => Ok(GeneratedField::Vote), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVoteResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVoteResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut vote__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Vote => { + if vote__.is_some() { + return Err(serde::de::Error::duplicate_field("vote")); + } + vote__ = map_.next_value()?; + } + } + } + Ok(QueryVoteResponse { + vote: vote__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryVoteResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVotesRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVotesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVotesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVotesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryVotesRequest { + proposal_id: proposal_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryVotesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVotesResponse", len)?; + if true { + struct_ser.serialize_field("votes", &self.votes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVotesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "votes", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Votes, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "votes" => Ok(GeneratedField::Votes), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVotesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVotesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut votes__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Votes => { + if votes__.is_some() { + return Err(serde::de::Error::duplicate_field("votes")); + } + votes__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryVotesResponse { + votes: votes__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryVotesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TallyParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.TallyParams", len)?; + if true { + struct_ser.serialize_field("quorum", &self.quorum)?; + } + if true { + struct_ser.serialize_field("threshold", &self.threshold)?; + } + if true { + struct_ser.serialize_field("vetoThreshold", &self.veto_threshold)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TallyParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "quorum", + "threshold", + "veto_threshold", + "vetoThreshold", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Quorum, + Threshold, + VetoThreshold, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "quorum" => Ok(GeneratedField::Quorum), + "threshold" => Ok(GeneratedField::Threshold), + "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TallyParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.TallyParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut quorum__ = None; + let mut threshold__ = None; + let mut veto_threshold__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Quorum => { + if quorum__.is_some() { + return Err(serde::de::Error::duplicate_field("quorum")); + } + quorum__ = Some(map_.next_value()?); + } + GeneratedField::Threshold => { + if threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("threshold")); + } + threshold__ = Some(map_.next_value()?); + } + GeneratedField::VetoThreshold => { + if veto_threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("vetoThreshold")); + } + veto_threshold__ = Some(map_.next_value()?); + } + } + } + Ok(TallyParams { + quorum: quorum__.unwrap_or_default(), + threshold: threshold__.unwrap_or_default(), + veto_threshold: veto_threshold__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.TallyParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TallyResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.TallyResult", len)?; + if true { + struct_ser.serialize_field("yesCount", &self.yes_count)?; + } + if true { + struct_ser.serialize_field("abstainCount", &self.abstain_count)?; + } + if true { + struct_ser.serialize_field("noCount", &self.no_count)?; + } + if true { + struct_ser.serialize_field("noWithVetoCount", &self.no_with_veto_count)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TallyResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "yes_count", + "yesCount", + "abstain_count", + "abstainCount", + "no_count", + "noCount", + "no_with_veto_count", + "noWithVetoCount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + YesCount, + AbstainCount, + NoCount, + NoWithVetoCount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "yesCount" | "yes_count" => Ok(GeneratedField::YesCount), + "abstainCount" | "abstain_count" => Ok(GeneratedField::AbstainCount), + "noCount" | "no_count" => Ok(GeneratedField::NoCount), + "noWithVetoCount" | "no_with_veto_count" => Ok(GeneratedField::NoWithVetoCount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TallyResult; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.TallyResult") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut yes_count__ = None; + let mut abstain_count__ = None; + let mut no_count__ = None; + let mut no_with_veto_count__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::YesCount => { + if yes_count__.is_some() { + return Err(serde::de::Error::duplicate_field("yesCount")); + } + yes_count__ = Some(map_.next_value()?); + } + GeneratedField::AbstainCount => { + if abstain_count__.is_some() { + return Err(serde::de::Error::duplicate_field("abstainCount")); + } + abstain_count__ = Some(map_.next_value()?); + } + GeneratedField::NoCount => { + if no_count__.is_some() { + return Err(serde::de::Error::duplicate_field("noCount")); + } + no_count__ = Some(map_.next_value()?); + } + GeneratedField::NoWithVetoCount => { + if no_with_veto_count__.is_some() { + return Err(serde::de::Error::duplicate_field("noWithVetoCount")); + } + no_with_veto_count__ = Some(map_.next_value()?); + } + } + } + Ok(TallyResult { + yes_count: yes_count__.unwrap_or_default(), + abstain_count: abstain_count__.unwrap_or_default(), + no_count: no_count__.unwrap_or_default(), + no_with_veto_count: no_with_veto_count__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.TallyResult", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Vote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Vote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + struct_ser.serialize_field("options", &self.options)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Vote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + "options", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Options, + Metadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + "options" => Ok(GeneratedField::Options), + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Vote; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Vote") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + let mut options__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(Vote { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + options: options__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.Vote", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for VoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "VOTE_OPTION_UNSPECIFIED", + Self::Yes => "VOTE_OPTION_YES", + Self::Abstain => "VOTE_OPTION_ABSTAIN", + Self::No => "VOTE_OPTION_NO", + Self::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for VoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "VOTE_OPTION_UNSPECIFIED", + "VOTE_OPTION_YES", + "VOTE_OPTION_ABSTAIN", + "VOTE_OPTION_NO", + "VOTE_OPTION_NO_WITH_VETO", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = VoteOption; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "VOTE_OPTION_UNSPECIFIED" => Ok(VoteOption::Unspecified), + "VOTE_OPTION_YES" => Ok(VoteOption::Yes), + "VOTE_OPTION_ABSTAIN" => Ok(VoteOption::Abstain), + "VOTE_OPTION_NO" => Ok(VoteOption::No), + "VOTE_OPTION_NO_WITH_VETO" => Ok(VoteOption::NoWithVeto), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for VotingParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.VotingParams", len)?; + if let Some(v) = self.voting_period.as_ref() { + struct_ser.serialize_field("votingPeriod", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for VotingParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "voting_period", + "votingPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = VotingParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.VotingParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut voting_period__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::VotingPeriod => { + if voting_period__.is_some() { + return Err(serde::de::Error::duplicate_field("votingPeriod")); + } + voting_period__ = map_.next_value()?; + } + } + } + Ok(VotingParams { + voting_period: voting_period__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.VotingParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for WeightedVoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.WeightedVoteOption", len)?; + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + if true { + struct_ser.serialize_field("weight", &self.weight)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for WeightedVoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "option", + "weight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Option, + Weight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "option" => Ok(GeneratedField::Option), + "weight" => Ok(GeneratedField::Weight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = WeightedVoteOption; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.WeightedVoteOption") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut option__ = None; + let mut weight__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Option => { + if option__.is_some() { + return Err(serde::de::Error::duplicate_field("option")); + } + option__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Weight => { + if weight__.is_some() { + return Err(serde::de::Error::duplicate_field("weight")); + } + weight__ = Some(map_.next_value()?); + } + } + } + Ok(WeightedVoteOption { + option: option__.unwrap_or_default(), + weight: weight__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.WeightedVoteOption", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs index b774ac4f..243010a5 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs @@ -860,6 +860,24 @@ pub mod msg_client { .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Deposit")); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -890,6 +908,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1157,6 +1179,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.gov.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs index ede6c2bc..36f1b54a 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs @@ -4,8 +4,10 @@ /// Since: cosmos-sdk 0.43 #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { + /// option defines the valid vote options, it must not contain duplicate vote options. #[prost(enumeration = "VoteOption", tag = "1")] pub option: i32, + /// weight is the vote weight associated with the vote option. #[prost(string, tag = "2")] pub weight: ::prost::alloc::string::String, } @@ -13,8 +15,10 @@ pub struct WeightedVoteOption { /// manually updated in case of approval. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TextProposal { + /// title of the proposal. #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description associated with the proposal. #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, } @@ -22,20 +26,26 @@ pub struct TextProposal { /// proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } /// Proposal defines the core field members of a governance proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// content is the proposal's content. #[prost(message, optional, tag = "2")] - pub content: ::core::option::Option<::prost_types::Any>, + pub content: ::core::option::Option<::prost_wkt_types::Any>, + /// status defines the proposal status. #[prost(enumeration = "ProposalStatus", tag = "3")] pub status: i32, /// final_tally_result is the final tally result of the proposal. When @@ -43,26 +53,35 @@ pub struct Proposal { /// proposal's voting period has ended. #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, + /// submit_time is the time of proposal submission. #[prost(message, optional, tag = "5")] - pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + pub submit_time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// deposit_end_time is the end time for deposition. #[prost(message, optional, tag = "6")] - pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub deposit_end_time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// total_deposit is the total deposit on the proposal. #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, + /// voting_start_time is the starting time to vote on a proposal. #[prost(message, optional, tag = "8")] - pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_start_time: ::core::option::Option<::prost_wkt_types::Timestamp>, + /// voting_end_time is the end time of voting on a proposal. #[prost(message, optional, tag = "9")] - pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_end_time: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// TallyResult defines a standard tally for a governance proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { + /// yes is the number of yes votes on a proposal. #[prost(string, tag = "1")] pub yes: ::prost::alloc::string::String, + /// abstain is the number of abstain votes on a proposal. #[prost(string, tag = "2")] pub abstain: ::prost::alloc::string::String, + /// no is the number of no votes on a proposal. #[prost(string, tag = "3")] pub no: ::prost::alloc::string::String, + /// no_with_veto is the number of no with veto votes on a proposal. #[prost(string, tag = "4")] pub no_with_veto: ::prost::alloc::string::String, } @@ -70,8 +89,10 @@ pub struct TallyResult { /// A Vote consists of a proposal ID, the voter, and the vote option. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// voter is the voter address of the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, /// Deprecated: Prefer to use `options` instead. This field is set in queries @@ -80,6 +101,8 @@ pub struct Vote { #[deprecated] #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, + /// options is the weighted vote options. + /// /// Since: cosmos-sdk 0.43 #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, @@ -87,33 +110,33 @@ pub struct Vote { /// DepositParams defines the params for deposits on governance proposals. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { - /// Minimum deposit for a proposal to enter voting period. + /// Minimum deposit for a proposal to enter voting period. #[prost(message, repeated, tag = "1")] pub min_deposit: ::prost::alloc::vec::Vec, - /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - /// months. + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. #[prost(message, optional, tag = "2")] - pub max_deposit_period: ::core::option::Option<::prost_types::Duration>, + pub max_deposit_period: ::core::option::Option<::prost_wkt_types::Duration>, } /// VotingParams defines the params for voting on governance proposals. #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { - /// Length of the voting period. + /// Duration of the voting period. #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option<::prost_types::Duration>, + pub voting_period: ::core::option::Option<::prost_wkt_types::Duration>, } /// TallyParams defines the params for tallying votes on governance proposals. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { - /// Minimum percentage of total stake needed to vote for a result to be - /// considered valid. + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. #[prost(bytes = "vec", tag = "1")] pub quorum: ::prost::alloc::vec::Vec, - /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. #[prost(bytes = "vec", tag = "2")] pub threshold: ::prost::alloc::vec::Vec, - /// Minimum value of Veto votes to Total votes ratio for proposal to be - /// vetoed. Default value: 1/3. + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. #[prost(bytes = "vec", tag = "3")] pub veto_threshold: ::prost::alloc::vec::Vec, } @@ -200,13 +223,13 @@ pub struct GenesisState { /// proposals defines all the proposals present at genesis. #[prost(message, repeated, tag = "4")] pub proposals: ::prost::alloc::vec::Vec, - /// params defines all the paramaters of related to deposit. + /// params defines all the parameters of related to deposit. #[prost(message, optional, tag = "5")] pub deposit_params: ::core::option::Option, - /// params defines all the paramaters of related to voting. + /// params defines all the parameters of related to voting. #[prost(message, optional, tag = "6")] pub voting_params: ::core::option::Option, - /// params defines all the paramaters of related to tally. + /// params defines all the parameters of related to tally. #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, } @@ -243,6 +266,7 @@ pub struct QueryProposalsRequest { /// method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { + /// proposals defines all the requested governance proposals. #[prost(message, repeated, tag = "1")] pub proposals: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -262,7 +286,7 @@ pub struct QueryVoteRequest { /// QueryVoteResponse is the response type for the Query/Vote RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { - /// vote defined the queried vote. + /// vote defines the queried vote. #[prost(message, optional, tag = "1")] pub vote: ::core::option::Option, } @@ -279,7 +303,7 @@ pub struct QueryVotesRequest { /// QueryVotesResponse is the response type for the Query/Votes RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { - /// votes defined the queried votes. + /// votes defines the queried votes. #[prost(message, repeated, tag = "1")] pub votes: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -337,6 +361,7 @@ pub struct QueryDepositsRequest { /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { + /// deposits defines the requested deposits. #[prost(message, repeated, tag = "1")] pub deposits: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. @@ -361,26 +386,33 @@ pub struct QueryTallyResultResponse { /// proposal Content. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { + /// content is the proposal's content. #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option<::prost_types::Any>, + pub content: ::core::option::Option<::prost_wkt_types::Any>, + /// initial_deposit is the deposit value that must be paid at proposal submission. #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, + /// proposer is the account address of the proposer. #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, } /// MsgVote defines a message to cast a vote. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// option defines the vote option. #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, } @@ -392,10 +424,13 @@ pub struct MsgVoteResponse {} /// Since: cosmos-sdk 0.43 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// options defines the weighted vote options. #[prost(message, repeated, tag = "3")] pub options: ::prost::alloc::vec::Vec, } @@ -407,10 +442,13 @@ pub struct MsgVoteWeightedResponse {} /// MsgDeposit defines a message to submit a deposit to an existing proposal. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { + /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.serde.rs new file mode 100644 index 00000000..1e738333 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.serde.rs @@ -0,0 +1,4091 @@ +impl serde::Serialize for Deposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Deposit", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Deposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "depositor", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "depositor" => Ok(GeneratedField::Depositor), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Deposit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.Deposit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut depositor__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(Deposit { + proposal_id: proposal_id__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.Deposit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DepositParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.DepositParams", len)?; + if true { + struct_ser.serialize_field("minDeposit", &self.min_deposit)?; + } + if let Some(v) = self.max_deposit_period.as_ref() { + struct_ser.serialize_field("maxDepositPeriod", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DepositParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "min_deposit", + "minDeposit", + "max_deposit_period", + "maxDepositPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MinDeposit, + MaxDepositPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "minDeposit" | "min_deposit" => Ok(GeneratedField::MinDeposit), + "maxDepositPeriod" | "max_deposit_period" => Ok(GeneratedField::MaxDepositPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DepositParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.DepositParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut min_deposit__ = None; + let mut max_deposit_period__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MinDeposit => { + if min_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("minDeposit")); + } + min_deposit__ = Some(map_.next_value()?); + } + GeneratedField::MaxDepositPeriod => { + if max_deposit_period__.is_some() { + return Err(serde::de::Error::duplicate_field("maxDepositPeriod")); + } + max_deposit_period__ = map_.next_value()?; + } + } + } + Ok(DepositParams { + min_deposit: min_deposit__.unwrap_or_default(), + max_deposit_period: max_deposit_period__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.DepositParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.GenesisState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startingProposalId", ::alloc::string::ToString::to_string(&self.starting_proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if true { + struct_ser.serialize_field("votes", &self.votes)?; + } + if true { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.deposit_params.as_ref() { + struct_ser.serialize_field("depositParams", v)?; + } + if let Some(v) = self.voting_params.as_ref() { + struct_ser.serialize_field("votingParams", v)?; + } + if let Some(v) = self.tally_params.as_ref() { + struct_ser.serialize_field("tallyParams", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "starting_proposal_id", + "startingProposalId", + "deposits", + "votes", + "proposals", + "deposit_params", + "depositParams", + "voting_params", + "votingParams", + "tally_params", + "tallyParams", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + StartingProposalId, + Deposits, + Votes, + Proposals, + DepositParams, + VotingParams, + TallyParams, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "startingProposalId" | "starting_proposal_id" => Ok(GeneratedField::StartingProposalId), + "deposits" => Ok(GeneratedField::Deposits), + "votes" => Ok(GeneratedField::Votes), + "proposals" => Ok(GeneratedField::Proposals), + "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), + "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), + "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut starting_proposal_id__ = None; + let mut deposits__ = None; + let mut votes__ = None; + let mut proposals__ = None; + let mut deposit_params__ = None; + let mut voting_params__ = None; + let mut tally_params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::StartingProposalId => { + if starting_proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("startingProposalId")); + } + starting_proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Deposits => { + if deposits__.is_some() { + return Err(serde::de::Error::duplicate_field("deposits")); + } + deposits__ = Some(map_.next_value()?); + } + GeneratedField::Votes => { + if votes__.is_some() { + return Err(serde::de::Error::duplicate_field("votes")); + } + votes__ = Some(map_.next_value()?); + } + GeneratedField::Proposals => { + if proposals__.is_some() { + return Err(serde::de::Error::duplicate_field("proposals")); + } + proposals__ = Some(map_.next_value()?); + } + GeneratedField::DepositParams => { + if deposit_params__.is_some() { + return Err(serde::de::Error::duplicate_field("depositParams")); + } + deposit_params__ = map_.next_value()?; + } + GeneratedField::VotingParams => { + if voting_params__.is_some() { + return Err(serde::de::Error::duplicate_field("votingParams")); + } + voting_params__ = map_.next_value()?; + } + GeneratedField::TallyParams => { + if tally_params__.is_some() { + return Err(serde::de::Error::duplicate_field("tallyParams")); + } + tally_params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + starting_proposal_id: starting_proposal_id__.unwrap_or_default(), + deposits: deposits__.unwrap_or_default(), + votes: votes__.unwrap_or_default(), + proposals: proposals__.unwrap_or_default(), + deposit_params: deposit_params__, + voting_params: voting_params__, + tally_params: tally_params__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgDeposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgDeposit", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgDeposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "depositor", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "depositor" => Ok(GeneratedField::Depositor), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDeposit; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgDeposit") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut depositor__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(MsgDeposit { + proposal_id: proposal_id__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgDeposit", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgDepositResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDepositResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgDepositResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgDepositResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgDepositResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgSubmitProposal", len)?; + if let Some(v) = self.content.as_ref() { + struct_ser.serialize_field("content", v)?; + } + if true { + struct_ser.serialize_field("initialDeposit", &self.initial_deposit)?; + } + if true { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "content", + "initial_deposit", + "initialDeposit", + "proposer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Content, + InitialDeposit, + Proposer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "content" => Ok(GeneratedField::Content), + "initialDeposit" | "initial_deposit" => Ok(GeneratedField::InitialDeposit), + "proposer" => Ok(GeneratedField::Proposer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut content__ = None; + let mut initial_deposit__ = None; + let mut proposer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Content => { + if content__.is_some() { + return Err(serde::de::Error::duplicate_field("content")); + } + content__ = map_.next_value()?; + } + GeneratedField::InitialDeposit => { + if initial_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("initialDeposit")); + } + initial_deposit__ = Some(map_.next_value()?); + } + GeneratedField::Proposer => { + if proposer__.is_some() { + return Err(serde::de::Error::duplicate_field("proposer")); + } + proposer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgSubmitProposal { + content: content__, + initial_deposit: initial_deposit__.unwrap_or_default(), + proposer: proposer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgSubmitProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgSubmitProposalResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgSubmitProposalResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgSubmitProposalResponse { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgSubmitProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + "option", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Option, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + "option" => Ok(GeneratedField::Option), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVote; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVote") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + let mut option__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Option => { + if option__.is_some() { + return Err(serde::de::Error::duplicate_field("option")); + } + option__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(MsgVote { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + option: option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVote", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVoteResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgVoteResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVoteResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVoteWeighted { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteWeighted", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + struct_ser.serialize_field("options", &self.options)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVoteWeighted { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + "options", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Options, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + "options" => Ok(GeneratedField::Options), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVoteWeighted; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteWeighted") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + let mut options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = Some(map_.next_value()?); + } + } + } + Ok(MsgVoteWeighted { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + options: options__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVoteWeighted", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteWeightedResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgVoteWeightedResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteWeightedResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgVoteWeightedResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.MsgVoteWeightedResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Proposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Proposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.content.as_ref() { + struct_ser.serialize_field("content", v)?; + } + if true { + let v = ProposalStatus::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; + struct_ser.serialize_field("status", &v)?; + } + if let Some(v) = self.final_tally_result.as_ref() { + struct_ser.serialize_field("finalTallyResult", v)?; + } + if let Some(v) = self.submit_time.as_ref() { + struct_ser.serialize_field("submitTime", v)?; + } + if let Some(v) = self.deposit_end_time.as_ref() { + struct_ser.serialize_field("depositEndTime", v)?; + } + if true { + struct_ser.serialize_field("totalDeposit", &self.total_deposit)?; + } + if let Some(v) = self.voting_start_time.as_ref() { + struct_ser.serialize_field("votingStartTime", v)?; + } + if let Some(v) = self.voting_end_time.as_ref() { + struct_ser.serialize_field("votingEndTime", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Proposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "content", + "status", + "final_tally_result", + "finalTallyResult", + "submit_time", + "submitTime", + "deposit_end_time", + "depositEndTime", + "total_deposit", + "totalDeposit", + "voting_start_time", + "votingStartTime", + "voting_end_time", + "votingEndTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Content, + Status, + FinalTallyResult, + SubmitTime, + DepositEndTime, + TotalDeposit, + VotingStartTime, + VotingEndTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "content" => Ok(GeneratedField::Content), + "status" => Ok(GeneratedField::Status), + "finalTallyResult" | "final_tally_result" => Ok(GeneratedField::FinalTallyResult), + "submitTime" | "submit_time" => Ok(GeneratedField::SubmitTime), + "depositEndTime" | "deposit_end_time" => Ok(GeneratedField::DepositEndTime), + "totalDeposit" | "total_deposit" => Ok(GeneratedField::TotalDeposit), + "votingStartTime" | "voting_start_time" => Ok(GeneratedField::VotingStartTime), + "votingEndTime" | "voting_end_time" => Ok(GeneratedField::VotingEndTime), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Proposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.Proposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut content__ = None; + let mut status__ = None; + let mut final_tally_result__ = None; + let mut submit_time__ = None; + let mut deposit_end_time__ = None; + let mut total_deposit__ = None; + let mut voting_start_time__ = None; + let mut voting_end_time__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Content => { + if content__.is_some() { + return Err(serde::de::Error::duplicate_field("content")); + } + content__ = map_.next_value()?; + } + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::FinalTallyResult => { + if final_tally_result__.is_some() { + return Err(serde::de::Error::duplicate_field("finalTallyResult")); + } + final_tally_result__ = map_.next_value()?; + } + GeneratedField::SubmitTime => { + if submit_time__.is_some() { + return Err(serde::de::Error::duplicate_field("submitTime")); + } + submit_time__ = map_.next_value()?; + } + GeneratedField::DepositEndTime => { + if deposit_end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("depositEndTime")); + } + deposit_end_time__ = map_.next_value()?; + } + GeneratedField::TotalDeposit => { + if total_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("totalDeposit")); + } + total_deposit__ = Some(map_.next_value()?); + } + GeneratedField::VotingStartTime => { + if voting_start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("votingStartTime")); + } + voting_start_time__ = map_.next_value()?; + } + GeneratedField::VotingEndTime => { + if voting_end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("votingEndTime")); + } + voting_end_time__ = map_.next_value()?; + } + } + } + Ok(Proposal { + proposal_id: proposal_id__.unwrap_or_default(), + content: content__, + status: status__.unwrap_or_default(), + final_tally_result: final_tally_result__, + submit_time: submit_time__, + deposit_end_time: deposit_end_time__, + total_deposit: total_deposit__.unwrap_or_default(), + voting_start_time: voting_start_time__, + voting_end_time: voting_end_time__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.Proposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProposalStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + Self::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", + Self::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", + Self::Passed => "PROPOSAL_STATUS_PASSED", + Self::Rejected => "PROPOSAL_STATUS_REJECTED", + Self::Failed => "PROPOSAL_STATUS_FAILED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ProposalStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "PROPOSAL_STATUS_UNSPECIFIED", + "PROPOSAL_STATUS_DEPOSIT_PERIOD", + "PROPOSAL_STATUS_VOTING_PERIOD", + "PROPOSAL_STATUS_PASSED", + "PROPOSAL_STATUS_REJECTED", + "PROPOSAL_STATUS_FAILED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProposalStatus; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Ok(ProposalStatus::Unspecified), + "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Ok(ProposalStatus::DepositPeriod), + "PROPOSAL_STATUS_VOTING_PERIOD" => Ok(ProposalStatus::VotingPeriod), + "PROPOSAL_STATUS_PASSED" => Ok(ProposalStatus::Passed), + "PROPOSAL_STATUS_REJECTED" => Ok(ProposalStatus::Rejected), + "PROPOSAL_STATUS_FAILED" => Ok(ProposalStatus::Failed), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "depositor", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "depositor" => Ok(GeneratedField::Depositor), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut depositor__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDepositRequest { + proposal_id: proposal_id__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositResponse", len)?; + if let Some(v) = self.deposit.as_ref() { + struct_ser.serialize_field("deposit", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "deposit", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposit, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "deposit" => Ok(GeneratedField::Deposit), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut deposit__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Deposit => { + if deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("deposit")); + } + deposit__ = map_.next_value()?; + } + } + } + Ok(QueryDepositResponse { + deposit: deposit__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositsRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDepositsRequest { + proposal_id: proposal_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDepositsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositsResponse", len)?; + if true { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDepositsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "deposits", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposits, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "deposits" => Ok(GeneratedField::Deposits), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDepositsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut deposits__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Deposits => { + if deposits__.is_some() { + return Err(serde::de::Error::duplicate_field("deposits")); + } + deposits__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDepositsResponse { + deposits: deposits__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryDepositsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryParamsRequest", len)?; + if true { + struct_ser.serialize_field("paramsType", &self.params_type)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params_type", + "paramsType", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ParamsType, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "paramsType" | "params_type" => Ok(GeneratedField::ParamsType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params_type__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ParamsType => { + if params_type__.is_some() { + return Err(serde::de::Error::duplicate_field("paramsType")); + } + params_type__ = Some(map_.next_value()?); + } + } + } + Ok(QueryParamsRequest { + params_type: params_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryParamsResponse", len)?; + if let Some(v) = self.voting_params.as_ref() { + struct_ser.serialize_field("votingParams", v)?; + } + if let Some(v) = self.deposit_params.as_ref() { + struct_ser.serialize_field("depositParams", v)?; + } + if let Some(v) = self.tally_params.as_ref() { + struct_ser.serialize_field("tallyParams", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "voting_params", + "votingParams", + "deposit_params", + "depositParams", + "tally_params", + "tallyParams", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingParams, + DepositParams, + TallyParams, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), + "depositParams" | "deposit_params" => Ok(GeneratedField::DepositParams), + "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut voting_params__ = None; + let mut deposit_params__ = None; + let mut tally_params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::VotingParams => { + if voting_params__.is_some() { + return Err(serde::de::Error::duplicate_field("votingParams")); + } + voting_params__ = map_.next_value()?; + } + GeneratedField::DepositParams => { + if deposit_params__.is_some() { + return Err(serde::de::Error::duplicate_field("depositParams")); + } + deposit_params__ = map_.next_value()?; + } + GeneratedField::TallyParams => { + if tally_params__.is_some() { + return Err(serde::de::Error::duplicate_field("tallyParams")); + } + tally_params__ = map_.next_value()?; + } + } + } + Ok(QueryParamsResponse { + voting_params: voting_params__, + deposit_params: deposit_params__, + tally_params: tally_params__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryProposalRequest { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalResponse", len)?; + if let Some(v) = self.proposal.as_ref() { + struct_ser.serialize_field("proposal", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposal, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposal" => Ok(GeneratedField::Proposal), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Proposal => { + if proposal__.is_some() { + return Err(serde::de::Error::duplicate_field("proposal")); + } + proposal__ = map_.next_value()?; + } + } + } + Ok(QueryProposalResponse { + proposal: proposal__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalsRequest", len)?; + if true { + let v = ProposalStatus::try_from(self.proposal_status) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.proposal_status)))?; + struct_ser.serialize_field("proposalStatus", &v)?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_status", + "proposalStatus", + "voter", + "depositor", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalStatus, + Voter, + Depositor, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalStatus" | "proposal_status" => Ok(GeneratedField::ProposalStatus), + "voter" => Ok(GeneratedField::Voter), + "depositor" => Ok(GeneratedField::Depositor), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_status__ = None; + let mut voter__ = None; + let mut depositor__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalStatus => { + if proposal_status__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalStatus")); + } + proposal_status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryProposalsRequest { + proposal_status: proposal_status__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + depositor: depositor__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalsResponse", len)?; + if true { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposals", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposals, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposals" => Ok(GeneratedField::Proposals), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposals__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Proposals => { + if proposals__.is_some() { + return Err(serde::de::Error::duplicate_field("proposals")); + } + proposals__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryProposalsResponse { + proposals: proposals__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryProposalsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTallyResultRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryTallyResultRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTallyResultRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryTallyResultRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryTallyResultRequest { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryTallyResultRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryTallyResultResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryTallyResultResponse", len)?; + if let Some(v) = self.tally.as_ref() { + struct_ser.serialize_field("tally", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tally", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tally, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "tally" => Ok(GeneratedField::Tally), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTallyResultResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryTallyResultResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tally__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Tally => { + if tally__.is_some() { + return Err(serde::de::Error::duplicate_field("tally")); + } + tally__ = map_.next_value()?; + } + } + } + Ok(QueryTallyResultResponse { + tally: tally__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryTallyResultResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVoteRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVoteRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVoteRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVoteRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVoteRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + } + } + Ok(QueryVoteRequest { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVoteRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVoteResponse", len)?; + if let Some(v) = self.vote.as_ref() { + struct_ser.serialize_field("vote", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "vote", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Vote, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "vote" => Ok(GeneratedField::Vote), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVoteResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVoteResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut vote__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Vote => { + if vote__.is_some() { + return Err(serde::de::Error::duplicate_field("vote")); + } + vote__ = map_.next_value()?; + } + } + } + Ok(QueryVoteResponse { + vote: vote__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVoteResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVotesRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVotesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVotesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVotesRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryVotesRequest { + proposal_id: proposal_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVotesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.QueryVotesResponse", len)?; + if true { + struct_ser.serialize_field("votes", &self.votes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVotesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "votes", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Votes, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "votes" => Ok(GeneratedField::Votes), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryVotesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVotesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut votes__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Votes => { + if votes__.is_some() { + return Err(serde::de::Error::duplicate_field("votes")); + } + votes__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryVotesResponse { + votes: votes__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.QueryVotesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TallyParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TallyParams", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("quorum", pbjson::private::base64::encode(&self.quorum).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("threshold", pbjson::private::base64::encode(&self.threshold).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("vetoThreshold", pbjson::private::base64::encode(&self.veto_threshold).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TallyParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "quorum", + "threshold", + "veto_threshold", + "vetoThreshold", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Quorum, + Threshold, + VetoThreshold, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "quorum" => Ok(GeneratedField::Quorum), + "threshold" => Ok(GeneratedField::Threshold), + "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TallyParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.TallyParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut quorum__ = None; + let mut threshold__ = None; + let mut veto_threshold__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Quorum => { + if quorum__.is_some() { + return Err(serde::de::Error::duplicate_field("quorum")); + } + quorum__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Threshold => { + if threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("threshold")); + } + threshold__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::VetoThreshold => { + if veto_threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("vetoThreshold")); + } + veto_threshold__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(TallyParams { + quorum: quorum__.unwrap_or_default(), + threshold: threshold__.unwrap_or_default(), + veto_threshold: veto_threshold__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.TallyParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TallyResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TallyResult", len)?; + if true { + struct_ser.serialize_field("yes", &self.yes)?; + } + if true { + struct_ser.serialize_field("abstain", &self.abstain)?; + } + if true { + struct_ser.serialize_field("no", &self.no)?; + } + if true { + struct_ser.serialize_field("noWithVeto", &self.no_with_veto)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TallyResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "yes", + "abstain", + "no", + "no_with_veto", + "noWithVeto", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Yes, + Abstain, + No, + NoWithVeto, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "yes" => Ok(GeneratedField::Yes), + "abstain" => Ok(GeneratedField::Abstain), + "no" => Ok(GeneratedField::No), + "noWithVeto" | "no_with_veto" => Ok(GeneratedField::NoWithVeto), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TallyResult; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.TallyResult") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut yes__ = None; + let mut abstain__ = None; + let mut no__ = None; + let mut no_with_veto__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Yes => { + if yes__.is_some() { + return Err(serde::de::Error::duplicate_field("yes")); + } + yes__ = Some(map_.next_value()?); + } + GeneratedField::Abstain => { + if abstain__.is_some() { + return Err(serde::de::Error::duplicate_field("abstain")); + } + abstain__ = Some(map_.next_value()?); + } + GeneratedField::No => { + if no__.is_some() { + return Err(serde::de::Error::duplicate_field("no")); + } + no__ = Some(map_.next_value()?); + } + GeneratedField::NoWithVeto => { + if no_with_veto__.is_some() { + return Err(serde::de::Error::duplicate_field("noWithVeto")); + } + no_with_veto__ = Some(map_.next_value()?); + } + } + } + Ok(TallyResult { + yes: yes__.unwrap_or_default(), + abstain: abstain__.unwrap_or_default(), + no: no__.unwrap_or_default(), + no_with_veto: no_with_veto__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.TallyResult", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TextProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TextProposal", len)?; + if true { + struct_ser.serialize_field("title", &self.title)?; + } + if true { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TextProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TextProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.TextProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut title__ = None; + let mut description__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Title => { + if title__.is_some() { + return Err(serde::de::Error::duplicate_field("title")); + } + title__ = Some(map_.next_value()?); + } + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(TextProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.TextProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Vote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Vote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + if true { + struct_ser.serialize_field("options", &self.options)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Vote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "voter", + "option", + "options", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Option, + Options, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "voter" => Ok(GeneratedField::Voter), + "option" => Ok(GeneratedField::Option), + "options" => Ok(GeneratedField::Options), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Vote; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.Vote") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut voter__ = None; + let mut option__ = None; + let mut options__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Option => { + if option__.is_some() { + return Err(serde::de::Error::duplicate_field("option")); + } + option__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = Some(map_.next_value()?); + } + } + } + Ok(Vote { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + option: option__.unwrap_or_default(), + options: options__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.Vote", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for VoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "VOTE_OPTION_UNSPECIFIED", + Self::Yes => "VOTE_OPTION_YES", + Self::Abstain => "VOTE_OPTION_ABSTAIN", + Self::No => "VOTE_OPTION_NO", + Self::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for VoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "VOTE_OPTION_UNSPECIFIED", + "VOTE_OPTION_YES", + "VOTE_OPTION_ABSTAIN", + "VOTE_OPTION_NO", + "VOTE_OPTION_NO_WITH_VETO", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = VoteOption; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "VOTE_OPTION_UNSPECIFIED" => Ok(VoteOption::Unspecified), + "VOTE_OPTION_YES" => Ok(VoteOption::Yes), + "VOTE_OPTION_ABSTAIN" => Ok(VoteOption::Abstain), + "VOTE_OPTION_NO" => Ok(VoteOption::No), + "VOTE_OPTION_NO_WITH_VETO" => Ok(VoteOption::NoWithVeto), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for VotingParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.VotingParams", len)?; + if let Some(v) = self.voting_period.as_ref() { + struct_ser.serialize_field("votingPeriod", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for VotingParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "voting_period", + "votingPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "votingPeriod" | "voting_period" => Ok(GeneratedField::VotingPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = VotingParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.VotingParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut voting_period__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::VotingPeriod => { + if voting_period__.is_some() { + return Err(serde::de::Error::duplicate_field("votingPeriod")); + } + voting_period__ = map_.next_value()?; + } + } + } + Ok(VotingParams { + voting_period: voting_period__, + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.VotingParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for WeightedVoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.WeightedVoteOption", len)?; + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + if true { + struct_ser.serialize_field("weight", &self.weight)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for WeightedVoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "option", + "weight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Option, + Weight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "option" => Ok(GeneratedField::Option), + "weight" => Ok(GeneratedField::Weight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = WeightedVoteOption; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.WeightedVoteOption") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut option__ = None; + let mut weight__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Option => { + if option__.is_some() { + return Err(serde::de::Error::duplicate_field("option")); + } + option__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Weight => { + if weight__.is_some() { + return Err(serde::de::Error::duplicate_field("weight")); + } + weight__ = Some(map_.next_value()?); + } + } + } + Ok(WeightedVoteOption { + option: option__.unwrap_or_default(), + weight: weight__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1beta1.WeightedVoteOption", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.module.v1.rs new file mode 100644 index 00000000..7a79b30a --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.module.v1.rs @@ -0,0 +1,14 @@ +// @generated +/// Module is the config object of the group module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// max_execution_period defines the max duration after a proposal's voting period ends that members can send a MsgExec + /// to execute the proposal. + #[prost(message, optional, tag = "1")] + pub max_execution_period: ::core::option::Option<::prost_wkt_types::Duration>, + /// max_metadata_len defines the max length of the metadata bytes field for various entities within the group module. + /// Defaults to 255 if not explicitly set. + #[prost(uint64, tag = "2")] + pub max_metadata_len: u64, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.module.v1.serde.rs new file mode 100644 index 00000000..a7644909 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.module.v1.serde.rs @@ -0,0 +1,113 @@ +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.group.module.v1.Module", len)?; + if let Some(v) = self.max_execution_period.as_ref() { + struct_ser.serialize_field("maxExecutionPeriod", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("maxMetadataLen", ::alloc::string::ToString::to_string(&self.max_metadata_len).as_str())?; + } + 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_execution_period", + "maxExecutionPeriod", + "max_metadata_len", + "maxMetadataLen", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MaxExecutionPeriod, + MaxMetadataLen, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "maxExecutionPeriod" | "max_execution_period" => Ok(GeneratedField::MaxExecutionPeriod), + "maxMetadataLen" | "max_metadata_len" => Ok(GeneratedField::MaxMetadataLen), + _ => 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.group.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut max_execution_period__ = None; + let mut max_metadata_len__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MaxExecutionPeriod => { + if max_execution_period__.is_some() { + return Err(serde::de::Error::duplicate_field("maxExecutionPeriod")); + } + max_execution_period__ = map_.next_value()?; + } + 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) + ; + } + } + } + Ok(Module { + max_execution_period: max_execution_period__, + max_metadata_len: max_metadata_len__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs index 4184a346..dc62683d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs @@ -14,7 +14,7 @@ pub struct Member { pub metadata: ::prost::alloc::string::String, /// added_at is a timestamp specifying when a member was added. #[prost(message, optional, tag = "4")] - pub added_at: ::core::option::Option<::prost_types::Timestamp>, + pub added_at: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// MemberRequest represents a group member to be used in Msg server requests. /// Contrary to `Member`, it doesn't have any `added_at` field @@ -33,7 +33,7 @@ pub struct MemberRequest { } /// ThresholdDecisionPolicy is a decision policy where a proposal passes when it /// satisfies the two following conditions: -/// 1. The sum of all `YES` voters' weights is greater or equal than the defined +/// 1. The sum of all `YES` voter's weights is greater or equal than the defined /// `threshold`. /// 2. The voting and execution periods of the proposal respect the parameters /// given by `windows`. @@ -55,7 +55,7 @@ pub struct ThresholdDecisionPolicy { /// given by `windows`. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PercentageDecisionPolicy { - /// percentage is the minimum percentage the weighted sum of `YES` votes must + /// percentage is the minimum percentage of the weighted sum of `YES` votes must /// meet for a proposal to succeed. #[prost(string, tag = "1")] pub percentage: ::prost::alloc::string::String, @@ -69,7 +69,7 @@ pub struct DecisionPolicyWindows { /// voting_period is the duration from submission of a proposal to the end of voting period /// Within this times votes can be submitted with MsgVote. #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option<::prost_types::Duration>, + pub voting_period: ::core::option::Option<::prost_wkt_types::Duration>, /// min_execution_period is the minimum duration after the proposal submission /// where members can start sending MsgExec. This means that the window for /// sending a MsgExec transaction is: @@ -82,7 +82,7 @@ pub struct DecisionPolicyWindows { /// is empty, meaning that all proposals created with this decision policy /// won't be able to be executed. #[prost(message, optional, tag = "2")] - pub min_execution_period: ::core::option::Option<::prost_types::Duration>, + pub min_execution_period: ::core::option::Option<::prost_wkt_types::Duration>, } // // State @@ -111,7 +111,7 @@ pub struct GroupInfo { pub total_weight: ::prost::alloc::string::String, /// created_at is a timestamp specifying when a group was created. #[prost(message, optional, tag = "6")] - pub created_at: ::core::option::Option<::prost_types::Timestamp>, + pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// GroupMember represents the relationship between a group and a member. #[derive(Clone, PartialEq, ::prost::Message)] @@ -135,7 +135,7 @@ pub struct GroupPolicyInfo { /// admin is the account address of the group admin. #[prost(string, tag = "3")] pub admin: ::prost::alloc::string::String, - /// metadata is any arbitrary metadata to attached to the group policy. + /// metadata is any arbitrary metadata attached to the group policy. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// version is used to track changes to a group's GroupPolicyInfo structure that @@ -144,10 +144,10 @@ pub struct GroupPolicyInfo { pub version: u64, /// decision_policy specifies the group policy's decision policy. #[prost(message, optional, tag = "6")] - pub decision_policy: ::core::option::Option<::prost_types::Any>, + pub decision_policy: ::core::option::Option<::prost_wkt_types::Any>, /// created_at is a timestamp specifying when a group policy was created. #[prost(message, optional, tag = "7")] - pub created_at: ::core::option::Option<::prost_types::Timestamp>, + pub created_at: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// Proposal defines a group proposal. Any member of a group can submit a proposal /// for a group policy to decide upon. @@ -161,7 +161,7 @@ pub struct Proposal { /// group_policy_address is the account address of group policy. #[prost(string, tag = "2")] pub group_policy_address: ::prost::alloc::string::String, - /// metadata is any arbitrary metadata to attached to the proposal. + /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, /// proposers are the account addresses of the proposers. @@ -169,7 +169,7 @@ pub struct Proposal { pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// submit_time is a timestamp specifying when a proposal was submitted. #[prost(message, optional, tag = "5")] - pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + pub submit_time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// group_version tracks the version of the group at proposal submission. /// This field is here for informational purposes only. #[prost(uint64, tag = "6")] @@ -190,18 +190,28 @@ pub struct Proposal { #[prost(message, optional, tag = "9")] pub final_tally_result: ::core::option::Option, /// voting_period_end is the timestamp before which voting must be done. - /// Unless a successfull MsgExec is called before (to execute a proposal whose + /// Unless a successful MsgExec is called before (to execute a proposal whose /// tally is successful before the voting period ends), tallying will be done /// at this point, and the `final_tally_result`and `status` fields will be /// accordingly updated. #[prost(message, optional, tag = "10")] - pub voting_period_end: ::core::option::Option<::prost_types::Timestamp>, + pub voting_period_end: ::core::option::Option<::prost_wkt_types::Timestamp>, /// executor_result is the final result of the proposal execution. Initial value is NotRun. #[prost(enumeration = "ProposalExecutorResult", tag = "11")] pub executor_result: i32, /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. #[prost(message, repeated, tag = "12")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, + /// title is the title of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "13")] + pub title: ::prost::alloc::string::String, + /// summary is a short summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "14")] + pub summary: ::prost::alloc::string::String, } /// TallyResult represents the sum of weighted votes for each vote option. #[derive(Clone, PartialEq, ::prost::Message)] @@ -231,12 +241,12 @@ pub struct Vote { /// option is the voter's choice on the proposal. #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, - /// metadata is any arbitrary metadata to attached to the vote. + /// metadata is any arbitrary metadata attached to the vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// submit_time is the timestamp when the vote was submitted. #[prost(message, optional, tag = "5")] - pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + pub submit_time: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// VoteOption enumerates the valid vote options for a given proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -405,19 +415,6 @@ pub struct EventLeaveGroup { #[prost(string, tag = "2")] pub address: ::prost::alloc::string::String, } -/// EventProposalPruned is an event emitted when a proposal is pruned. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EventProposalPruned { - /// proposal_id is the unique ID of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// status is the proposal status (UNSPECIFIED, SUBMITTED, ACCEPTED, REJECTED, ABORTED, WITHDRAWN). - #[prost(enumeration = "ProposalStatus", tag = "2")] - pub status: i32, - /// tally_result is the proposal tally result (when applicable). - #[prost(message, optional, tag = "3")] - pub tally_result: ::core::option::Option, -} /// GenesisState defines the group module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { @@ -459,7 +456,7 @@ pub struct QueryGroupInfoRequest { /// QueryGroupInfoResponse is the Query/GroupInfo response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupInfoResponse { - /// info is the GroupInfo for the group. + /// info is the GroupInfo of the group. #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, } @@ -473,7 +470,7 @@ pub struct QueryGroupPolicyInfoRequest { /// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPolicyInfoResponse { - /// info is the GroupPolicyInfo for the group policy. + /// info is the GroupPolicyInfo of the group policy. #[prost(message, optional, tag = "1")] pub info: ::core::option::Option, } @@ -682,27 +679,6 @@ pub struct QueryTallyResultResponse { #[prost(message, optional, tag = "1")] pub tally: ::core::option::Option, } -/// QueryGroupsRequest is the Query/Groups request type. -/// -/// Since: cosmos-sdk 0.47.1 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryGroupsRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, -} -/// QueryGroupsResponse is the Query/Groups response type. -/// -/// Since: cosmos-sdk 0.47.1 -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryGroupsResponse { - /// `groups` is all the groups present in state. - #[prost(message, repeated, tag = "1")] - pub groups: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option, -} // // Groups // @@ -794,7 +770,7 @@ pub struct MsgCreateGroupPolicy { pub metadata: ::prost::alloc::string::String, /// decision_policy specifies the group policy's decision policy. #[prost(message, optional, tag = "4")] - pub decision_policy: ::core::option::Option<::prost_types::Any>, + pub decision_policy: ::core::option::Option<::prost_wkt_types::Any>, } /// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. #[derive(Clone, PartialEq, ::prost::Message)] @@ -816,6 +792,9 @@ pub struct MsgUpdateGroupPolicyAdmin { #[prost(string, tag = "3")] pub new_admin: ::prost::alloc::string::String, } +/// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyAdminResponse {} /// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupWithPolicy { @@ -837,7 +816,7 @@ pub struct MsgCreateGroupWithPolicy { pub group_policy_as_admin: bool, /// decision_policy specifies the group policy's decision policy. #[prost(message, optional, tag = "6")] - pub decision_policy: ::core::option::Option<::prost_types::Any>, + pub decision_policy: ::core::option::Option<::prost_wkt_types::Any>, } /// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. #[derive(Clone, PartialEq, ::prost::Message)] @@ -849,9 +828,6 @@ pub struct MsgCreateGroupWithPolicyResponse { #[prost(string, tag = "2")] pub group_policy_address: ::prost::alloc::string::String, } -/// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateGroupPolicyAdminResponse {} /// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyDecisionPolicy { @@ -863,7 +839,7 @@ pub struct MsgUpdateGroupPolicyDecisionPolicy { pub group_policy_address: ::prost::alloc::string::String, /// decision_policy is the updated group policy's decision policy. #[prost(message, optional, tag = "3")] - pub decision_policy: ::core::option::Option<::prost_types::Any>, + pub decision_policy: ::core::option::Option<::prost_wkt_types::Any>, } /// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. #[derive(Clone, PartialEq, ::prost::Message)] @@ -877,7 +853,7 @@ pub struct MsgUpdateGroupPolicyMetadata { /// group_policy_address is the account address of group policy. #[prost(string, tag = "2")] pub group_policy_address: ::prost::alloc::string::String, - /// metadata is the updated group policy metadata. + /// metadata is the group policy metadata to be updated. #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, } @@ -894,17 +870,27 @@ pub struct MsgSubmitProposal { /// Proposers signatures will be counted as yes votes. #[prost(string, repeated, tag = "2")] pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// metadata is any arbitrary metadata to attached to the proposal. + /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. #[prost(message, repeated, tag = "4")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, /// exec defines the mode of execution of the proposal, /// whether it should be executed immediately on creation or not. /// If so, proposers signatures are considered as Yes votes. #[prost(enumeration = "Exec", tag = "5")] pub exec: i32, + /// title is the title of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "6")] + pub title: ::prost::alloc::string::String, + /// summary is the summary of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "7")] + pub summary: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. #[derive(Clone, PartialEq, ::prost::Message)] @@ -938,7 +924,7 @@ pub struct MsgVote { /// option is the voter's choice on the proposal. #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, - /// metadata is any arbitrary metadata to attached to the vote. + /// metadata is any arbitrary metadata attached to the vote. #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// exec defines whether the proposal should be executed diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs new file mode 100644 index 00000000..cbe3f3a8 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs @@ -0,0 +1,8902 @@ +impl serde::Serialize for DecisionPolicyWindows { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.DecisionPolicyWindows", len)?; + if let Some(v) = self.voting_period.as_ref() { + struct_ser.serialize_field("votingPeriod", v)?; + } + if let Some(v) = self.min_execution_period.as_ref() { + struct_ser.serialize_field("minExecutionPeriod", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DecisionPolicyWindows { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "voting_period", + "votingPeriod", + "min_execution_period", + "minExecutionPeriod", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingPeriod, + MinExecutionPeriod, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "minExecutionPeriod" | "min_execution_period" => Ok(GeneratedField::MinExecutionPeriod), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DecisionPolicyWindows; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.DecisionPolicyWindows") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut voting_period__ = None; + let mut min_execution_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()?; + } + GeneratedField::MinExecutionPeriod => { + if min_execution_period__.is_some() { + return Err(serde::de::Error::duplicate_field("minExecutionPeriod")); + } + min_execution_period__ = map_.next_value()?; + } + } + } + Ok(DecisionPolicyWindows { + voting_period: voting_period__, + min_execution_period: min_execution_period__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.DecisionPolicyWindows", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventCreateGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventCreateGroup", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventCreateGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventCreateGroup; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventCreateGroup") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(EventCreateGroup { + group_id: group_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventCreateGroup", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventCreateGroupPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventCreateGroupPolicy", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventCreateGroupPolicy { + #[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 = EventCreateGroupPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventCreateGroupPolicy") + } + + 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(EventCreateGroupPolicy { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventCreateGroupPolicy", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventExec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.EventExec", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + let v = ProposalExecutorResult::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + if true { + struct_ser.serialize_field("logs", &self.logs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventExec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "result", + "logs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Result, + Logs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "result" => Ok(GeneratedField::Result), + "logs" => Ok(GeneratedField::Logs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventExec; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventExec") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut result__ = None; + let mut logs__ = 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::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Logs => { + if logs__.is_some() { + return Err(serde::de::Error::duplicate_field("logs")); + } + logs__ = Some(map_.next_value()?); + } + } + } + Ok(EventExec { + proposal_id: proposal_id__.unwrap_or_default(), + result: result__.unwrap_or_default(), + logs: logs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventExec", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventLeaveGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventLeaveGroup", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventLeaveGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + "address", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + 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 { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "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 = EventLeaveGroup; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventLeaveGroup") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + let mut address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(EventLeaveGroup { + group_id: group_id__.unwrap_or_default(), + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventLeaveGroup", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventSubmitProposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventSubmitProposal { + #[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 = EventSubmitProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventSubmitProposal") + } + + 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(EventSubmitProposal { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventSubmitProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventUpdateGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventUpdateGroup", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventUpdateGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventUpdateGroup; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventUpdateGroup") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(EventUpdateGroup { + group_id: group_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventUpdateGroup", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventUpdateGroupPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventUpdateGroupPolicy", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventUpdateGroupPolicy { + #[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 = EventUpdateGroupPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventUpdateGroupPolicy") + } + + 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(EventUpdateGroupPolicy { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventUpdateGroupPolicy", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventVote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventVote { + #[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 = EventVote; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventVote") + } + + 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(EventVote { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventVote", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventWithdrawProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventWithdrawProposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventWithdrawProposal { + #[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 = EventWithdrawProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventWithdrawProposal") + } + + 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(EventWithdrawProposal { + proposal_id: proposal_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventWithdrawProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Exec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "EXEC_UNSPECIFIED", + Self::Try => "EXEC_TRY", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for Exec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "EXEC_UNSPECIFIED", + "EXEC_TRY", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Exec; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "EXEC_UNSPECIFIED" => Ok(Exec::Unspecified), + "EXEC_TRY" => Ok(Exec::Try), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(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.group.v1.GenesisState", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupSeq", ::alloc::string::ToString::to_string(&self.group_seq).as_str())?; + } + if true { + struct_ser.serialize_field("groups", &self.groups)?; + } + if true { + struct_ser.serialize_field("groupMembers", &self.group_members)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupPolicySeq", ::alloc::string::ToString::to_string(&self.group_policy_seq).as_str())?; + } + if true { + struct_ser.serialize_field("groupPolicies", &self.group_policies)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalSeq", ::alloc::string::ToString::to_string(&self.proposal_seq).as_str())?; + } + if true { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if true { + struct_ser.serialize_field("votes", &self.votes)?; + } + 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] = &[ + "group_seq", + "groupSeq", + "groups", + "group_members", + "groupMembers", + "group_policy_seq", + "groupPolicySeq", + "group_policies", + "groupPolicies", + "proposal_seq", + "proposalSeq", + "proposals", + "votes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupSeq, + Groups, + GroupMembers, + GroupPolicySeq, + GroupPolicies, + ProposalSeq, + Proposals, + Votes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupSeq" | "group_seq" => Ok(GeneratedField::GroupSeq), + "groups" => Ok(GeneratedField::Groups), + "groupMembers" | "group_members" => Ok(GeneratedField::GroupMembers), + "groupPolicySeq" | "group_policy_seq" => Ok(GeneratedField::GroupPolicySeq), + "groupPolicies" | "group_policies" => Ok(GeneratedField::GroupPolicies), + "proposalSeq" | "proposal_seq" => Ok(GeneratedField::ProposalSeq), + "proposals" => Ok(GeneratedField::Proposals), + "votes" => Ok(GeneratedField::Votes), + _ => 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.group.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_seq__ = None; + let mut groups__ = None; + let mut group_members__ = None; + let mut group_policy_seq__ = None; + let mut group_policies__ = None; + let mut proposal_seq__ = None; + let mut proposals__ = None; + let mut votes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupSeq => { + if group_seq__.is_some() { + return Err(serde::de::Error::duplicate_field("groupSeq")); + } + group_seq__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Groups => { + if groups__.is_some() { + return Err(serde::de::Error::duplicate_field("groups")); + } + groups__ = Some(map_.next_value()?); + } + GeneratedField::GroupMembers => { + if group_members__.is_some() { + return Err(serde::de::Error::duplicate_field("groupMembers")); + } + group_members__ = Some(map_.next_value()?); + } + GeneratedField::GroupPolicySeq => { + if group_policy_seq__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicySeq")); + } + group_policy_seq__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::GroupPolicies => { + if group_policies__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicies")); + } + group_policies__ = Some(map_.next_value()?); + } + GeneratedField::ProposalSeq => { + if proposal_seq__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalSeq")); + } + proposal_seq__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Proposals => { + if proposals__.is_some() { + return Err(serde::de::Error::duplicate_field("proposals")); + } + proposals__ = Some(map_.next_value()?); + } + GeneratedField::Votes => { + if votes__.is_some() { + return Err(serde::de::Error::duplicate_field("votes")); + } + votes__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + group_seq: group_seq__.unwrap_or_default(), + groups: groups__.unwrap_or_default(), + group_members: group_members__.unwrap_or_default(), + group_policy_seq: group_policy_seq__.unwrap_or_default(), + group_policies: group_policies__.unwrap_or_default(), + proposal_seq: proposal_seq__.unwrap_or_default(), + proposals: proposals__.unwrap_or_default(), + votes: votes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GroupInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.group.v1.GroupInfo", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; + } + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + if true { + struct_ser.serialize_field("totalWeight", &self.total_weight)?; + } + if let Some(v) = self.created_at.as_ref() { + struct_ser.serialize_field("createdAt", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GroupInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "admin", + "metadata", + "version", + "total_weight", + "totalWeight", + "created_at", + "createdAt", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + Admin, + Metadata, + Version, + TotalWeight, + CreatedAt, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "admin" => Ok(GeneratedField::Admin), + "metadata" => Ok(GeneratedField::Metadata), + "version" => Ok(GeneratedField::Version), + "totalWeight" | "total_weight" => Ok(GeneratedField::TotalWeight), + "createdAt" | "created_at" => Ok(GeneratedField::CreatedAt), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GroupInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GroupInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut admin__ = None; + let mut metadata__ = None; + let mut version__ = None; + let mut total_weight__ = None; + let mut created_at__ = 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::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = 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) + ; + } + GeneratedField::TotalWeight => { + if total_weight__.is_some() { + return Err(serde::de::Error::duplicate_field("totalWeight")); + } + total_weight__ = Some(map_.next_value()?); + } + GeneratedField::CreatedAt => { + if created_at__.is_some() { + return Err(serde::de::Error::duplicate_field("createdAt")); + } + created_at__ = map_.next_value()?; + } + } + } + Ok(GroupInfo { + id: id__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + version: version__.unwrap_or_default(), + total_weight: total_weight__.unwrap_or_default(), + created_at: created_at__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.GroupInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GroupMember { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.GroupMember", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if let Some(v) = self.member.as_ref() { + struct_ser.serialize_field("member", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GroupMember { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + "member", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + Member, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "member" => Ok(GeneratedField::Member), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GroupMember; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GroupMember") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + let mut member__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Member => { + if member__.is_some() { + return Err(serde::de::Error::duplicate_field("member")); + } + member__ = map_.next_value()?; + } + } + } + Ok(GroupMember { + group_id: group_id__.unwrap_or_default(), + member: member__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.GroupMember", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GroupPolicyInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.group.v1.GroupPolicyInfo", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + if let Some(v) = self.decision_policy.as_ref() { + struct_ser.serialize_field("decisionPolicy", v)?; + } + if let Some(v) = self.created_at.as_ref() { + struct_ser.serialize_field("createdAt", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GroupPolicyInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "group_id", + "groupId", + "admin", + "metadata", + "version", + "decision_policy", + "decisionPolicy", + "created_at", + "createdAt", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + GroupId, + Admin, + Metadata, + Version, + DecisionPolicy, + CreatedAt, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "admin" => Ok(GeneratedField::Admin), + "metadata" => Ok(GeneratedField::Metadata), + "version" => Ok(GeneratedField::Version), + "decisionPolicy" | "decision_policy" => Ok(GeneratedField::DecisionPolicy), + "createdAt" | "created_at" => Ok(GeneratedField::CreatedAt), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GroupPolicyInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GroupPolicyInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut group_id__ = None; + let mut admin__ = None; + let mut metadata__ = None; + let mut version__ = None; + let mut decision_policy__ = None; + let mut created_at__ = 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::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = 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) + ; + } + GeneratedField::DecisionPolicy => { + if decision_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("decisionPolicy")); + } + decision_policy__ = map_.next_value()?; + } + GeneratedField::CreatedAt => { + if created_at__.is_some() { + return Err(serde::de::Error::duplicate_field("createdAt")); + } + created_at__ = map_.next_value()?; + } + } + } + Ok(GroupPolicyInfo { + address: address__.unwrap_or_default(), + group_id: group_id__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + version: version__.unwrap_or_default(), + decision_policy: decision_policy__, + created_at: created_at__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.GroupPolicyInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Member { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.group.v1.Member", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + struct_ser.serialize_field("weight", &self.weight)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if let Some(v) = self.added_at.as_ref() { + struct_ser.serialize_field("addedAt", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Member { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "weight", + "metadata", + "added_at", + "addedAt", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Weight, + Metadata, + AddedAt, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "weight" => Ok(GeneratedField::Weight), + "metadata" => Ok(GeneratedField::Metadata), + "addedAt" | "added_at" => Ok(GeneratedField::AddedAt), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Member; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.Member") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut weight__ = None; + let mut metadata__ = None; + let mut added_at__ = 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::Weight => { + if weight__.is_some() { + return Err(serde::de::Error::duplicate_field("weight")); + } + weight__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::AddedAt => { + if added_at__.is_some() { + return Err(serde::de::Error::duplicate_field("addedAt")); + } + added_at__ = map_.next_value()?; + } + } + } + Ok(Member { + address: address__.unwrap_or_default(), + weight: weight__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + added_at: added_at__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.Member", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MemberRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MemberRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + struct_ser.serialize_field("weight", &self.weight)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MemberRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "weight", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Weight, + 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 { + "address" => Ok(GeneratedField::Address), + "weight" => Ok(GeneratedField::Weight), + "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 = MemberRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MemberRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut weight__ = None; + let mut metadata__ = 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::Weight => { + if weight__.is_some() { + return Err(serde::de::Error::duplicate_field("weight")); + } + weight__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(MemberRequest { + address: address__.unwrap_or_default(), + weight: weight__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MemberRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgCreateGroup", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("members", &self.members)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "members", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Members, + 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 { + "admin" => Ok(GeneratedField::Admin), + "members" => Ok(GeneratedField::Members), + "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 = MsgCreateGroup; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroup") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut members__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Members => { + if members__.is_some() { + return Err(serde::de::Error::duplicate_field("members")); + } + members__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateGroup { + admin: admin__.unwrap_or_default(), + members: members__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgCreateGroup", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateGroupPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.group.v1.MsgCreateGroupPolicy", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if let Some(v) = self.decision_policy.as_ref() { + struct_ser.serialize_field("decisionPolicy", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateGroupPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_id", + "groupId", + "metadata", + "decision_policy", + "decisionPolicy", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupId, + Metadata, + DecisionPolicy, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "metadata" => Ok(GeneratedField::Metadata), + "decisionPolicy" | "decision_policy" => Ok(GeneratedField::DecisionPolicy), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateGroupPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupPolicy") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_id__ = None; + let mut metadata__ = None; + let mut decision_policy__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::DecisionPolicy => { + if decision_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("decisionPolicy")); + } + decision_policy__ = map_.next_value()?; + } + } + } + Ok(MsgCreateGroupPolicy { + admin: admin__.unwrap_or_default(), + group_id: group_id__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + decision_policy: decision_policy__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgCreateGroupPolicy", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateGroupPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupPolicyResponse", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateGroupPolicyResponse { + #[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 = MsgCreateGroupPolicyResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupPolicyResponse") + } + + 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(MsgCreateGroupPolicyResponse { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgCreateGroupPolicyResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateGroupResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateGroupResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateGroupResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgCreateGroupResponse { + group_id: group_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgCreateGroupResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateGroupWithPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.group.v1.MsgCreateGroupWithPolicy", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("members", &self.members)?; + } + if true { + struct_ser.serialize_field("groupMetadata", &self.group_metadata)?; + } + if true { + struct_ser.serialize_field("groupPolicyMetadata", &self.group_policy_metadata)?; + } + if true { + struct_ser.serialize_field("groupPolicyAsAdmin", &self.group_policy_as_admin)?; + } + if let Some(v) = self.decision_policy.as_ref() { + struct_ser.serialize_field("decisionPolicy", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateGroupWithPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "members", + "group_metadata", + "groupMetadata", + "group_policy_metadata", + "groupPolicyMetadata", + "group_policy_as_admin", + "groupPolicyAsAdmin", + "decision_policy", + "decisionPolicy", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Members, + GroupMetadata, + GroupPolicyMetadata, + GroupPolicyAsAdmin, + DecisionPolicy, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "members" => Ok(GeneratedField::Members), + "groupMetadata" | "group_metadata" => Ok(GeneratedField::GroupMetadata), + "groupPolicyMetadata" | "group_policy_metadata" => Ok(GeneratedField::GroupPolicyMetadata), + "groupPolicyAsAdmin" | "group_policy_as_admin" => Ok(GeneratedField::GroupPolicyAsAdmin), + "decisionPolicy" | "decision_policy" => Ok(GeneratedField::DecisionPolicy), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateGroupWithPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupWithPolicy") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut members__ = None; + let mut group_metadata__ = None; + let mut group_policy_metadata__ = None; + let mut group_policy_as_admin__ = None; + let mut decision_policy__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Members => { + if members__.is_some() { + return Err(serde::de::Error::duplicate_field("members")); + } + members__ = Some(map_.next_value()?); + } + GeneratedField::GroupMetadata => { + if group_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("groupMetadata")); + } + group_metadata__ = Some(map_.next_value()?); + } + GeneratedField::GroupPolicyMetadata => { + if group_policy_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyMetadata")); + } + group_policy_metadata__ = Some(map_.next_value()?); + } + GeneratedField::GroupPolicyAsAdmin => { + if group_policy_as_admin__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAsAdmin")); + } + group_policy_as_admin__ = Some(map_.next_value()?); + } + GeneratedField::DecisionPolicy => { + if decision_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("decisionPolicy")); + } + decision_policy__ = map_.next_value()?; + } + } + } + Ok(MsgCreateGroupWithPolicy { + admin: admin__.unwrap_or_default(), + members: members__.unwrap_or_default(), + group_metadata: group_metadata__.unwrap_or_default(), + group_policy_metadata: group_policy_metadata__.unwrap_or_default(), + group_policy_as_admin: group_policy_as_admin__.unwrap_or_default(), + decision_policy: decision_policy__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgCreateGroupWithPolicy", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateGroupWithPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupWithPolicyResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateGroupWithPolicyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + "group_policy_address", + "groupPolicyAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + GroupPolicyAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "groupPolicyAddress" | "group_policy_address" => Ok(GeneratedField::GroupPolicyAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateGroupWithPolicyResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupWithPolicyResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + let mut group_policy_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::GroupPolicyAddress => { + if group_policy_address__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAddress")); + } + group_policy_address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateGroupWithPolicyResponse { + group_id: group_id__.unwrap_or_default(), + group_policy_address: group_policy_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgCreateGroupWithPolicyResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgExec", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("executor", &self.executor)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "executor", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Executor, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "executor" => Ok(GeneratedField::Executor), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgExec; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgExec") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut executor__ = 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::Executor => { + if executor__.is_some() { + return Err(serde::de::Error::duplicate_field("executor")); + } + executor__ = Some(map_.next_value()?); + } + } + } + Ok(MsgExec { + proposal_id: proposal_id__.unwrap_or_default(), + executor: executor__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgExec", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExecResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgExecResponse", len)?; + if true { + let v = ProposalExecutorResult::try_from(self.result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.result)))?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExecResponse { + #[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 = MsgExecResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgExecResponse") + } + + 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(MsgExecResponse { + result: result__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgExecResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgLeaveGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgLeaveGroup", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgLeaveGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "group_id", + "groupId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + GroupId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgLeaveGroup; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgLeaveGroup") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut group_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::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgLeaveGroup { + address: address__.unwrap_or_default(), + group_id: group_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgLeaveGroup", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgLeaveGroupResponse { + #[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.group.v1.MsgLeaveGroupResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgLeaveGroupResponse { + #[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 = MsgLeaveGroupResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgLeaveGroupResponse") + } + + 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(MsgLeaveGroupResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgLeaveGroupResponse", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgSubmitProposal", len)?; + if true { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if true { + struct_ser.serialize_field("proposers", &self.proposers)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + struct_ser.serialize_field("messages", &self.messages)?; + } + if true { + let v = Exec::try_from(self.exec) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.exec)))?; + struct_ser.serialize_field("exec", &v)?; + } + 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] = &[ + "group_policy_address", + "groupPolicyAddress", + "proposers", + "metadata", + "messages", + "exec", + "title", + "summary", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupPolicyAddress, + Proposers, + Metadata, + Messages, + Exec, + 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 { + "groupPolicyAddress" | "group_policy_address" => Ok(GeneratedField::GroupPolicyAddress), + "proposers" => Ok(GeneratedField::Proposers), + "metadata" => Ok(GeneratedField::Metadata), + "messages" => Ok(GeneratedField::Messages), + "exec" => Ok(GeneratedField::Exec), + "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.group.v1.MsgSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_policy_address__ = None; + let mut proposers__ = None; + let mut metadata__ = None; + let mut messages__ = None; + let mut exec__ = None; + let mut title__ = None; + let mut summary__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupPolicyAddress => { + if group_policy_address__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAddress")); + } + group_policy_address__ = Some(map_.next_value()?); + } + GeneratedField::Proposers => { + if proposers__.is_some() { + return Err(serde::de::Error::duplicate_field("proposers")); + } + proposers__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Messages => { + if messages__.is_some() { + return Err(serde::de::Error::duplicate_field("messages")); + } + messages__ = Some(map_.next_value()?); + } + GeneratedField::Exec => { + if exec__.is_some() { + return Err(serde::de::Error::duplicate_field("exec")); + } + exec__ = Some(map_.next_value::()? as i32); + } + 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 { + group_policy_address: group_policy_address__.unwrap_or_default(), + proposers: proposers__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + messages: messages__.unwrap_or_default(), + exec: exec__.unwrap_or_default(), + title: title__.unwrap_or_default(), + summary: summary__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.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.group.v1.MsgSubmitProposalResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSubmitProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.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.group.v1.MsgSubmitProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgUpdateGroupAdmin", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_id", + "groupId", + "new_admin", + "newAdmin", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupId, + NewAdmin, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "newAdmin" | "new_admin" => Ok(GeneratedField::NewAdmin), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateGroupAdmin; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupAdmin") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_id__ = None; + let mut new_admin__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::NewAdmin => { + if new_admin__.is_some() { + return Err(serde::de::Error::duplicate_field("newAdmin")); + } + new_admin__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateGroupAdmin { + admin: admin__.unwrap_or_default(), + group_id: group_id__.unwrap_or_default(), + new_admin: new_admin__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupAdmin", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupAdminResponse { + #[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.group.v1.MsgUpdateGroupAdminResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupAdminResponse { + #[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 = MsgUpdateGroupAdminResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupAdminResponse") + } + + 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(MsgUpdateGroupAdminResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupAdminResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupMembers { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgUpdateGroupMembers", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("memberUpdates", &self.member_updates)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMembers { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_id", + "groupId", + "member_updates", + "memberUpdates", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupId, + MemberUpdates, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "memberUpdates" | "member_updates" => Ok(GeneratedField::MemberUpdates), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateGroupMembers; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMembers") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_id__ = None; + let mut member_updates__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::MemberUpdates => { + if member_updates__.is_some() { + return Err(serde::de::Error::duplicate_field("memberUpdates")); + } + member_updates__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateGroupMembers { + admin: admin__.unwrap_or_default(), + group_id: group_id__.unwrap_or_default(), + member_updates: member_updates__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupMembers", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupMembersResponse { + #[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.group.v1.MsgUpdateGroupMembersResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMembersResponse { + #[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 = MsgUpdateGroupMembersResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMembersResponse") + } + + 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(MsgUpdateGroupMembersResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupMembersResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgUpdateGroupMetadata", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_id", + "groupId", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupId, + 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 { + "admin" => Ok(GeneratedField::Admin), + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "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 = MsgUpdateGroupMetadata; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMetadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_id__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateGroupMetadata { + admin: admin__.unwrap_or_default(), + group_id: group_id__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupMetadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupMetadataResponse { + #[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.group.v1.MsgUpdateGroupMetadataResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMetadataResponse { + #[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 = MsgUpdateGroupMetadataResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMetadataResponse") + } + + 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(MsgUpdateGroupMetadataResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupMetadataResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupPolicyAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgUpdateGroupPolicyAdmin", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if true { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_policy_address", + "groupPolicyAddress", + "new_admin", + "newAdmin", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupPolicyAddress, + NewAdmin, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "groupPolicyAddress" | "group_policy_address" => Ok(GeneratedField::GroupPolicyAddress), + "newAdmin" | "new_admin" => Ok(GeneratedField::NewAdmin), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateGroupPolicyAdmin; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyAdmin") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_policy_address__ = None; + let mut new_admin__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupPolicyAddress => { + if group_policy_address__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAddress")); + } + group_policy_address__ = Some(map_.next_value()?); + } + GeneratedField::NewAdmin => { + if new_admin__.is_some() { + return Err(serde::de::Error::duplicate_field("newAdmin")); + } + new_admin__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateGroupPolicyAdmin { + admin: admin__.unwrap_or_default(), + group_policy_address: group_policy_address__.unwrap_or_default(), + new_admin: new_admin__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyAdmin", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupPolicyAdminResponse { + #[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.group.v1.MsgUpdateGroupPolicyAdminResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyAdminResponse { + #[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 = MsgUpdateGroupPolicyAdminResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse") + } + + 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(MsgUpdateGroupPolicyAdminResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupPolicyDecisionPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgUpdateGroupPolicyDecisionPolicy", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if let Some(v) = self.decision_policy.as_ref() { + struct_ser.serialize_field("decisionPolicy", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyDecisionPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_policy_address", + "groupPolicyAddress", + "decision_policy", + "decisionPolicy", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupPolicyAddress, + DecisionPolicy, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "groupPolicyAddress" | "group_policy_address" => Ok(GeneratedField::GroupPolicyAddress), + "decisionPolicy" | "decision_policy" => Ok(GeneratedField::DecisionPolicy), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateGroupPolicyDecisionPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_policy_address__ = None; + let mut decision_policy__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupPolicyAddress => { + if group_policy_address__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAddress")); + } + group_policy_address__ = Some(map_.next_value()?); + } + GeneratedField::DecisionPolicy => { + if decision_policy__.is_some() { + return Err(serde::de::Error::duplicate_field("decisionPolicy")); + } + decision_policy__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateGroupPolicyDecisionPolicy { + admin: admin__.unwrap_or_default(), + group_policy_address: group_policy_address__.unwrap_or_default(), + decision_policy: decision_policy__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupPolicyDecisionPolicyResponse { + #[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.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyDecisionPolicyResponse { + #[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 = MsgUpdateGroupPolicyDecisionPolicyResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse") + } + + 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(MsgUpdateGroupPolicyDecisionPolicyResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupPolicyMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.group.v1.MsgUpdateGroupPolicyMetadata", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "group_policy_address", + "groupPolicyAddress", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + GroupPolicyAddress, + 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 { + "admin" => Ok(GeneratedField::Admin), + "groupPolicyAddress" | "group_policy_address" => Ok(GeneratedField::GroupPolicyAddress), + "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 = MsgUpdateGroupPolicyMetadata; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyMetadata") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut group_policy_address__ = None; + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::GroupPolicyAddress => { + if group_policy_address__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAddress")); + } + group_policy_address__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateGroupPolicyMetadata { + admin: admin__.unwrap_or_default(), + group_policy_address: group_policy_address__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyMetadata", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateGroupPolicyMetadataResponse { + #[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.group.v1.MsgUpdateGroupPolicyMetadataResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyMetadataResponse { + #[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 = MsgUpdateGroupPolicyMetadataResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse") + } + + 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(MsgUpdateGroupPolicyMetadataResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgVote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + let v = Exec::try_from(self.exec) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.exec)))?; + struct_ser.serialize_field("exec", &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", + "metadata", + "exec", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Option, + Metadata, + Exec, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "exec" => Ok(GeneratedField::Exec), + _ => 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.group.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; + let mut exec__ = 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()?); + } + GeneratedField::Exec => { + if exec__.is_some() { + return Err(serde::de::Error::duplicate_field("exec")); + } + exec__ = 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(), + metadata: metadata__.unwrap_or_default(), + exec: exec__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.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.group.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.group.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.group.v1.MsgVoteResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgWithdrawProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgWithdrawProposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgWithdrawProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "address", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + 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 { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "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 = MsgWithdrawProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgWithdrawProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut address__ = 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::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgWithdrawProposal { + proposal_id: proposal_id__.unwrap_or_default(), + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgWithdrawProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgWithdrawProposalResponse { + #[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.group.v1.MsgWithdrawProposalResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgWithdrawProposalResponse { + #[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 = MsgWithdrawProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgWithdrawProposalResponse") + } + + 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(MsgWithdrawProposalResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.MsgWithdrawProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PercentageDecisionPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.PercentageDecisionPolicy", len)?; + if true { + struct_ser.serialize_field("percentage", &self.percentage)?; + } + if let Some(v) = self.windows.as_ref() { + struct_ser.serialize_field("windows", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PercentageDecisionPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "percentage", + "windows", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Percentage, + Windows, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "percentage" => Ok(GeneratedField::Percentage), + "windows" => Ok(GeneratedField::Windows), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PercentageDecisionPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.PercentageDecisionPolicy") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut percentage__ = None; + let mut windows__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Percentage => { + if percentage__.is_some() { + return Err(serde::de::Error::duplicate_field("percentage")); + } + percentage__ = Some(map_.next_value()?); + } + GeneratedField::Windows => { + if windows__.is_some() { + return Err(serde::de::Error::duplicate_field("windows")); + } + windows__ = map_.next_value()?; + } + } + } + Ok(PercentageDecisionPolicy { + percentage: percentage__.unwrap_or_default(), + windows: windows__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.PercentageDecisionPolicy", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.Proposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ::alloc::string::ToString::to_string(&self.id).as_str())?; + } + if true { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if true { + struct_ser.serialize_field("proposers", &self.proposers)?; + } + if let Some(v) = self.submit_time.as_ref() { + struct_ser.serialize_field("submitTime", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupVersion", ::alloc::string::ToString::to_string(&self.group_version).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupPolicyVersion", ::alloc::string::ToString::to_string(&self.group_policy_version).as_str())?; + } + if true { + let v = ProposalStatus::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; + struct_ser.serialize_field("status", &v)?; + } + if let Some(v) = self.final_tally_result.as_ref() { + struct_ser.serialize_field("finalTallyResult", v)?; + } + if let Some(v) = self.voting_period_end.as_ref() { + struct_ser.serialize_field("votingPeriodEnd", v)?; + } + if true { + let v = ProposalExecutorResult::try_from(self.executor_result) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.executor_result)))?; + struct_ser.serialize_field("executorResult", &v)?; + } + if true { + struct_ser.serialize_field("messages", &self.messages)?; + } + 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 Proposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "group_policy_address", + "groupPolicyAddress", + "metadata", + "proposers", + "submit_time", + "submitTime", + "group_version", + "groupVersion", + "group_policy_version", + "groupPolicyVersion", + "status", + "final_tally_result", + "finalTallyResult", + "voting_period_end", + "votingPeriodEnd", + "executor_result", + "executorResult", + "messages", + "title", + "summary", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + GroupPolicyAddress, + Metadata, + Proposers, + SubmitTime, + GroupVersion, + GroupPolicyVersion, + Status, + FinalTallyResult, + VotingPeriodEnd, + ExecutorResult, + Messages, + 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 { + "id" => Ok(GeneratedField::Id), + "groupPolicyAddress" | "group_policy_address" => Ok(GeneratedField::GroupPolicyAddress), + "metadata" => Ok(GeneratedField::Metadata), + "proposers" => Ok(GeneratedField::Proposers), + "submitTime" | "submit_time" => Ok(GeneratedField::SubmitTime), + "groupVersion" | "group_version" => Ok(GeneratedField::GroupVersion), + "groupPolicyVersion" | "group_policy_version" => Ok(GeneratedField::GroupPolicyVersion), + "status" => Ok(GeneratedField::Status), + "finalTallyResult" | "final_tally_result" => Ok(GeneratedField::FinalTallyResult), + "votingPeriodEnd" | "voting_period_end" => Ok(GeneratedField::VotingPeriodEnd), + "executorResult" | "executor_result" => Ok(GeneratedField::ExecutorResult), + "messages" => Ok(GeneratedField::Messages), + "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 = Proposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.Proposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut group_policy_address__ = None; + let mut metadata__ = None; + let mut proposers__ = None; + let mut submit_time__ = None; + let mut group_version__ = None; + let mut group_policy_version__ = None; + let mut status__ = None; + let mut final_tally_result__ = None; + let mut voting_period_end__ = None; + let mut executor_result__ = None; + let mut messages__ = None; + let mut title__ = None; + let mut summary__ = 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::GroupPolicyAddress => { + if group_policy_address__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyAddress")); + } + group_policy_address__ = Some(map_.next_value()?); + } + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = Some(map_.next_value()?); + } + GeneratedField::Proposers => { + if proposers__.is_some() { + return Err(serde::de::Error::duplicate_field("proposers")); + } + proposers__ = Some(map_.next_value()?); + } + GeneratedField::SubmitTime => { + if submit_time__.is_some() { + return Err(serde::de::Error::duplicate_field("submitTime")); + } + submit_time__ = map_.next_value()?; + } + GeneratedField::GroupVersion => { + if group_version__.is_some() { + return Err(serde::de::Error::duplicate_field("groupVersion")); + } + group_version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::GroupPolicyVersion => { + if group_policy_version__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicyVersion")); + } + group_policy_version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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::VotingPeriodEnd => { + if voting_period_end__.is_some() { + return Err(serde::de::Error::duplicate_field("votingPeriodEnd")); + } + voting_period_end__ = map_.next_value()?; + } + GeneratedField::ExecutorResult => { + if executor_result__.is_some() { + return Err(serde::de::Error::duplicate_field("executorResult")); + } + executor_result__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Messages => { + if messages__.is_some() { + return Err(serde::de::Error::duplicate_field("messages")); + } + messages__ = 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(Proposal { + id: id__.unwrap_or_default(), + group_policy_address: group_policy_address__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + proposers: proposers__.unwrap_or_default(), + submit_time: submit_time__, + group_version: group_version__.unwrap_or_default(), + group_policy_version: group_policy_version__.unwrap_or_default(), + status: status__.unwrap_or_default(), + final_tally_result: final_tally_result__, + voting_period_end: voting_period_end__, + executor_result: executor_result__.unwrap_or_default(), + messages: messages__.unwrap_or_default(), + title: title__.unwrap_or_default(), + summary: summary__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.Proposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ProposalExecutorResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED", + Self::NotRun => "PROPOSAL_EXECUTOR_RESULT_NOT_RUN", + Self::Success => "PROPOSAL_EXECUTOR_RESULT_SUCCESS", + Self::Failure => "PROPOSAL_EXECUTOR_RESULT_FAILURE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ProposalExecutorResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED", + "PROPOSAL_EXECUTOR_RESULT_NOT_RUN", + "PROPOSAL_EXECUTOR_RESULT_SUCCESS", + "PROPOSAL_EXECUTOR_RESULT_FAILURE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProposalExecutorResult; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED" => Ok(ProposalExecutorResult::Unspecified), + "PROPOSAL_EXECUTOR_RESULT_NOT_RUN" => Ok(ProposalExecutorResult::NotRun), + "PROPOSAL_EXECUTOR_RESULT_SUCCESS" => Ok(ProposalExecutorResult::Success), + "PROPOSAL_EXECUTOR_RESULT_FAILURE" => Ok(ProposalExecutorResult::Failure), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(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::Submitted => "PROPOSAL_STATUS_SUBMITTED", + Self::Accepted => "PROPOSAL_STATUS_ACCEPTED", + Self::Rejected => "PROPOSAL_STATUS_REJECTED", + Self::Aborted => "PROPOSAL_STATUS_ABORTED", + Self::Withdrawn => "PROPOSAL_STATUS_WITHDRAWN", + }; + 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_SUBMITTED", + "PROPOSAL_STATUS_ACCEPTED", + "PROPOSAL_STATUS_REJECTED", + "PROPOSAL_STATUS_ABORTED", + "PROPOSAL_STATUS_WITHDRAWN", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ProposalStatus; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Ok(ProposalStatus::Unspecified), + "PROPOSAL_STATUS_SUBMITTED" => Ok(ProposalStatus::Submitted), + "PROPOSAL_STATUS_ACCEPTED" => Ok(ProposalStatus::Accepted), + "PROPOSAL_STATUS_REJECTED" => Ok(ProposalStatus::Rejected), + "PROPOSAL_STATUS_ABORTED" => Ok(ProposalStatus::Aborted), + "PROPOSAL_STATUS_WITHDRAWN" => Ok(ProposalStatus::Withdrawn), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupInfoRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryGroupInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupInfoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryGroupInfoRequest { + group_id: group_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupInfoResponse", len)?; + if let Some(v) = self.info.as_ref() { + struct_ser.serialize_field("info", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupInfoResponse { + #[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 = QueryGroupInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupInfoResponse") + } + + 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(QueryGroupInfoResponse { + info: info__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupMembersRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupMembersRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_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 QueryGroupMembersRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + 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 { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "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 = QueryGroupMembersRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupMembersRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_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(QueryGroupMembersRequest { + group_id: group_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupMembersRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupMembersResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupMembersResponse", len)?; + if true { + struct_ser.serialize_field("members", &self.members)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupMembersResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "members", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Members, + 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 { + "members" => Ok(GeneratedField::Members), + "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 = QueryGroupMembersResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupMembersResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut members__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Members => { + if members__.is_some() { + return Err(serde::de::Error::duplicate_field("members")); + } + members__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupMembersResponse { + members: members__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupMembersResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupPoliciesByAdminRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupPoliciesByAdminRequest", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByAdminRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + 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 { + "admin" => Ok(GeneratedField::Admin), + "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 = QueryGroupPoliciesByAdminRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByAdminRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupPoliciesByAdminRequest { + admin: admin__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupPoliciesByAdminRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupPoliciesByAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupPoliciesByAdminResponse", len)?; + if true { + struct_ser.serialize_field("groupPolicies", &self.group_policies)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_policies", + "groupPolicies", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupPolicies, + 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 { + "groupPolicies" | "group_policies" => Ok(GeneratedField::GroupPolicies), + "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 = QueryGroupPoliciesByAdminResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByAdminResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_policies__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupPolicies => { + if group_policies__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicies")); + } + group_policies__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupPoliciesByAdminResponse { + group_policies: group_policies__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupPoliciesByAdminResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupPoliciesByGroupRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupPoliciesByGroupRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ::alloc::string::ToString::to_string(&self.group_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 QueryGroupPoliciesByGroupRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_id", + "groupId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + 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 { + "groupId" | "group_id" => Ok(GeneratedField::GroupId), + "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 = QueryGroupPoliciesByGroupRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByGroupRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupId => { + if group_id__.is_some() { + return Err(serde::de::Error::duplicate_field("groupId")); + } + group_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(QueryGroupPoliciesByGroupRequest { + group_id: group_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupPoliciesByGroupRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupPoliciesByGroupResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupPoliciesByGroupResponse", len)?; + if true { + struct_ser.serialize_field("groupPolicies", &self.group_policies)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByGroupResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_policies", + "groupPolicies", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupPolicies, + 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 { + "groupPolicies" | "group_policies" => Ok(GeneratedField::GroupPolicies), + "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 = QueryGroupPoliciesByGroupResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByGroupResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut group_policies__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GroupPolicies => { + if group_policies__.is_some() { + return Err(serde::de::Error::duplicate_field("groupPolicies")); + } + group_policies__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupPoliciesByGroupResponse { + group_policies: group_policies__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupPoliciesByGroupResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupPolicyInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupPolicyInfoRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupPolicyInfoRequest { + #[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 = QueryGroupPolicyInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPolicyInfoRequest") + } + + 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(QueryGroupPolicyInfoRequest { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupPolicyInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupPolicyInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupPolicyInfoResponse", len)?; + if let Some(v) = self.info.as_ref() { + struct_ser.serialize_field("info", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupPolicyInfoResponse { + #[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 = QueryGroupPolicyInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPolicyInfoResponse") + } + + 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(QueryGroupPolicyInfoResponse { + info: info__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupPolicyInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupsByAdminRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupsByAdminRequest", len)?; + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupsByAdminRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "admin", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + 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 { + "admin" => Ok(GeneratedField::Admin), + "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 = QueryGroupsByAdminRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByAdminRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupsByAdminRequest { + admin: admin__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupsByAdminRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupsByAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupsByAdminResponse", len)?; + if true { + struct_ser.serialize_field("groups", &self.groups)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupsByAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "groups", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Groups, + 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 { + "groups" => Ok(GeneratedField::Groups), + "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 = QueryGroupsByAdminResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByAdminResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut groups__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Groups => { + if groups__.is_some() { + return Err(serde::de::Error::duplicate_field("groups")); + } + groups__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupsByAdminResponse { + groups: groups__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupsByAdminResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupsByMemberRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupsByMemberRequest", 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 QueryGroupsByMemberRequest { + #[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 = QueryGroupsByMemberRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByMemberRequest") + } + + 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(QueryGroupsByMemberRequest { + address: address__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupsByMemberRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryGroupsByMemberResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryGroupsByMemberResponse", len)?; + if true { + struct_ser.serialize_field("groups", &self.groups)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryGroupsByMemberResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "groups", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Groups, + 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 { + "groups" => Ok(GeneratedField::Groups), + "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 = QueryGroupsByMemberResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByMemberResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut groups__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Groups => { + if groups__.is_some() { + return Err(serde::de::Error::duplicate_field("groups")); + } + groups__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryGroupsByMemberResponse { + groups: groups__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryGroupsByMemberResponse", 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.group.v1.QueryProposalRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryProposalRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.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.group.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.group.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.group.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.group.v1.QueryProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalsByGroupPolicyRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryProposalsByGroupPolicyRequest", 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 QueryProposalsByGroupPolicyRequest { + #[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 = QueryProposalsByGroupPolicyRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryProposalsByGroupPolicyRequest") + } + + 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(QueryProposalsByGroupPolicyRequest { + address: address__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryProposalsByGroupPolicyRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryProposalsByGroupPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryProposalsByGroupPolicyResponse", 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 QueryProposalsByGroupPolicyResponse { + #[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 = QueryProposalsByGroupPolicyResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryProposalsByGroupPolicyResponse") + } + + 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(QueryProposalsByGroupPolicyResponse { + proposals: proposals__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryProposalsByGroupPolicyResponse", 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.group.v1.QueryTallyResultRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryTallyResultRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.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.group.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.group.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.group.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.group.v1.QueryTallyResultResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVoteByProposalVoterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryVoteByProposalVoterRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVoteByProposalVoterRequest { + #[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 = QueryVoteByProposalVoterRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVoteByProposalVoterRequest") + } + + 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(QueryVoteByProposalVoterRequest { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryVoteByProposalVoterRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVoteByProposalVoterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryVoteByProposalVoterResponse", len)?; + if let Some(v) = self.vote.as_ref() { + struct_ser.serialize_field("vote", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVoteByProposalVoterResponse { + #[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 = QueryVoteByProposalVoterResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVoteByProposalVoterResponse") + } + + 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(QueryVoteByProposalVoterResponse { + vote: vote__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryVoteByProposalVoterResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesByProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryVotesByProposalRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVotesByProposalRequest { + #[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 = QueryVotesByProposalRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByProposalRequest") + } + + 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(QueryVotesByProposalRequest { + proposal_id: proposal_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryVotesByProposalRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesByProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryVotesByProposalResponse", 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 QueryVotesByProposalResponse { + #[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 = QueryVotesByProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByProposalResponse") + } + + 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(QueryVotesByProposalResponse { + votes: votes__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryVotesByProposalResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesByVoterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryVotesByVoterRequest", len)?; + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryVotesByVoterRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "voter", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Voter, + 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 { + "voter" => Ok(GeneratedField::Voter), + "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 = QueryVotesByVoterRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByVoterRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut voter__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Voter => { + if voter__.is_some() { + return Err(serde::de::Error::duplicate_field("voter")); + } + voter__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryVotesByVoterRequest { + voter: voter__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryVotesByVoterRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryVotesByVoterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.QueryVotesByVoterResponse", 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 QueryVotesByVoterResponse { + #[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 = QueryVotesByVoterResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByVoterResponse") + } + + 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(QueryVotesByVoterResponse { + votes: votes__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.QueryVotesByVoterResponse", 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.group.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.group.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.group.v1.TallyResult", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ThresholdDecisionPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.ThresholdDecisionPolicy", len)?; + if true { + struct_ser.serialize_field("threshold", &self.threshold)?; + } + if let Some(v) = self.windows.as_ref() { + struct_ser.serialize_field("windows", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ThresholdDecisionPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "threshold", + "windows", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Threshold, + Windows, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "windows" => Ok(GeneratedField::Windows), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ThresholdDecisionPolicy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.ThresholdDecisionPolicy") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut threshold__ = None; + let mut windows__ = 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()?); + } + GeneratedField::Windows => { + if windows__.is_some() { + return Err(serde::de::Error::duplicate_field("windows")); + } + windows__ = map_.next_value()?; + } + } + } + Ok(ThresholdDecisionPolicy { + threshold: threshold__.unwrap_or_default(), + windows: windows__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.ThresholdDecisionPolicy", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.Vote", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("voter", &self.voter)?; + } + if true { + let v = VoteOption::try_from(self.option) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.option)))?; + struct_ser.serialize_field("option", &v)?; + } + if true { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if let Some(v) = self.submit_time.as_ref() { + struct_ser.serialize_field("submitTime", v)?; + } + 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", + "metadata", + "submit_time", + "submitTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + Option, + Metadata, + SubmitTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "submitTime" | "submit_time" => Ok(GeneratedField::SubmitTime), + _ => 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.group.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 option__ = None; + let mut metadata__ = None; + let mut submit_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::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()?); + } + GeneratedField::SubmitTime => { + if submit_time__.is_some() { + return Err(serde::de::Error::duplicate_field("submitTime")); + } + submit_time__ = map_.next_value()?; + } + } + } + Ok(Vote { + proposal_id: proposal_id__.unwrap_or_default(), + voter: voter__.unwrap_or_default(), + option: option__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + submit_time: submit_time__, + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.Vote", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for VoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "VOTE_OPTION_UNSPECIFIED", + Self::Yes => "VOTE_OPTION_YES", + Self::Abstain => "VOTE_OPTION_ABSTAIN", + Self::No => "VOTE_OPTION_NO", + Self::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for VoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "VOTE_OPTION_UNSPECIFIED", + "VOTE_OPTION_YES", + "VOTE_OPTION_ABSTAIN", + "VOTE_OPTION_NO", + "VOTE_OPTION_NO_WITH_VETO", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = VoteOption; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "VOTE_OPTION_UNSPECIFIED" => Ok(VoteOption::Unspecified), + "VOTE_OPTION_YES" => Ok(VoteOption::Yes), + "VOTE_OPTION_ABSTAIN" => Ok(VoteOption::Abstain), + "VOTE_OPTION_NO" => Ok(VoteOption::No), + "VOTE_OPTION_NO_WITH_VETO" => Ok(VoteOption::NoWithVeto), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs index b49aa300..25c1336a 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs @@ -343,24 +343,6 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.group.v1.Query", "TallyResult")); self.inner.unary(req, path, codec).await } - pub async fn groups( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/Groups"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.group.v1.Query", "Groups")); - self.inner.unary(req, path, codec).await - } } } /// Generated server implementations. @@ -435,10 +417,6 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; - async fn groups( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -1033,44 +1011,6 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.group.v1.Query/Groups" => { - #[allow(non_camel_case_types)] - struct GroupsSvc(pub Arc); - impl tonic::server::UnaryService for GroupsSvc { - type Response = super::QueryGroupsResponse; - type Future = BoxFuture, tonic::Status>; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).groups(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GroupsSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.module.v1.rs new file mode 100644 index 00000000..ac7a55a1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.module.v1.rs @@ -0,0 +1,11 @@ +// @generated +/// Module is the config object of the mint module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + #[prost(string, tag = "1")] + pub fee_collector_name: ::prost::alloc::string::String, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.module.v1.serde.rs new file mode 100644 index 00000000..afe5e333 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.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.mint.module.v1.Module", len)?; + if true { + struct_ser.serialize_field("feeCollectorName", &self.fee_collector_name)?; + } + 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] = &[ + "fee_collector_name", + "feeCollectorName", + "authority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FeeCollectorName, + 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 { + "feeCollectorName" | "fee_collector_name" => Ok(GeneratedField::FeeCollectorName), + "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.mint.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fee_collector_name__ = None; + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::FeeCollectorName => { + if fee_collector_name__.is_some() { + return Err(serde::de::Error::duplicate_field("feeCollectorName")); + } + fee_collector_name__ = 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 { + fee_collector_name: fee_collector_name__.unwrap_or_default(), + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.mint.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs index 70d49802..4640cdc1 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs @@ -9,7 +9,7 @@ pub struct Minter { #[prost(string, tag = "2")] pub annual_provisions: ::prost::alloc::string::String, } -/// Params holds parameters for the mint module. +/// Params defines the parameters for the x/mint module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// type of coin to mint @@ -37,7 +37,7 @@ pub struct GenesisState { /// minter is a space for holding current inflation information. #[prost(message, optional, tag = "1")] pub minter: ::core::option::Option, - /// params defines all the paramaters of the module. + /// params defines all the parameters of the module. #[prost(message, optional, tag = "2")] pub params: ::core::option::Option, } @@ -74,5 +74,25 @@ pub struct QueryAnnualProvisionsResponse { #[prost(bytes = "vec", tag = "1")] pub annual_provisions: ::prost::alloc::vec::Vec, } +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/mint parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("cosmos.mint.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.serde.rs new file mode 100644 index 00000000..a3df0693 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.serde.rs @@ -0,0 +1,1074 @@ +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.mint.v1beta1.GenesisState", len)?; + if let Some(v) = self.minter.as_ref() { + struct_ser.serialize_field("minter", 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] = &[ + "minter", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Minter, + 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 { + "minter" => Ok(GeneratedField::Minter), + "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.mint.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut minter__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Minter => { + if minter__.is_some() { + return Err(serde::de::Error::duplicate_field("minter")); + } + minter__ = map_.next_value()?; + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + minter: minter__, + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Minter { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.mint.v1beta1.Minter", len)?; + if true { + struct_ser.serialize_field("inflation", &self.inflation)?; + } + if true { + struct_ser.serialize_field("annualProvisions", &self.annual_provisions)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Minter { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "inflation", + "annual_provisions", + "annualProvisions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inflation, + AnnualProvisions, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "inflation" => Ok(GeneratedField::Inflation), + "annualProvisions" | "annual_provisions" => Ok(GeneratedField::AnnualProvisions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Minter; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.Minter") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut inflation__ = None; + let mut annual_provisions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Inflation => { + if inflation__.is_some() { + return Err(serde::de::Error::duplicate_field("inflation")); + } + inflation__ = Some(map_.next_value()?); + } + GeneratedField::AnnualProvisions => { + if annual_provisions__.is_some() { + return Err(serde::de::Error::duplicate_field("annualProvisions")); + } + annual_provisions__ = Some(map_.next_value()?); + } + } + } + Ok(Minter { + inflation: inflation__.unwrap_or_default(), + annual_provisions: annual_provisions__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.Minter", 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.mint.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.mint.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.mint.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.mint.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.mint.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.mint.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.mint.v1beta1.Params", len)?; + if true { + struct_ser.serialize_field("mintDenom", &self.mint_denom)?; + } + if true { + struct_ser.serialize_field("inflationRateChange", &self.inflation_rate_change)?; + } + if true { + struct_ser.serialize_field("inflationMax", &self.inflation_max)?; + } + if true { + struct_ser.serialize_field("inflationMin", &self.inflation_min)?; + } + if true { + struct_ser.serialize_field("goalBonded", &self.goal_bonded)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("blocksPerYear", ::alloc::string::ToString::to_string(&self.blocks_per_year).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] = &[ + "mint_denom", + "mintDenom", + "inflation_rate_change", + "inflationRateChange", + "inflation_max", + "inflationMax", + "inflation_min", + "inflationMin", + "goal_bonded", + "goalBonded", + "blocks_per_year", + "blocksPerYear", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MintDenom, + InflationRateChange, + InflationMax, + InflationMin, + GoalBonded, + BlocksPerYear, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "mintDenom" | "mint_denom" => Ok(GeneratedField::MintDenom), + "inflationRateChange" | "inflation_rate_change" => Ok(GeneratedField::InflationRateChange), + "inflationMax" | "inflation_max" => Ok(GeneratedField::InflationMax), + "inflationMin" | "inflation_min" => Ok(GeneratedField::InflationMin), + "goalBonded" | "goal_bonded" => Ok(GeneratedField::GoalBonded), + "blocksPerYear" | "blocks_per_year" => Ok(GeneratedField::BlocksPerYear), + _ => 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.mint.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut mint_denom__ = None; + let mut inflation_rate_change__ = None; + let mut inflation_max__ = None; + let mut inflation_min__ = None; + let mut goal_bonded__ = None; + let mut blocks_per_year__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MintDenom => { + if mint_denom__.is_some() { + return Err(serde::de::Error::duplicate_field("mintDenom")); + } + mint_denom__ = Some(map_.next_value()?); + } + GeneratedField::InflationRateChange => { + if inflation_rate_change__.is_some() { + return Err(serde::de::Error::duplicate_field("inflationRateChange")); + } + inflation_rate_change__ = Some(map_.next_value()?); + } + GeneratedField::InflationMax => { + if inflation_max__.is_some() { + return Err(serde::de::Error::duplicate_field("inflationMax")); + } + inflation_max__ = Some(map_.next_value()?); + } + GeneratedField::InflationMin => { + if inflation_min__.is_some() { + return Err(serde::de::Error::duplicate_field("inflationMin")); + } + inflation_min__ = Some(map_.next_value()?); + } + GeneratedField::GoalBonded => { + if goal_bonded__.is_some() { + return Err(serde::de::Error::duplicate_field("goalBonded")); + } + goal_bonded__ = Some(map_.next_value()?); + } + GeneratedField::BlocksPerYear => { + if blocks_per_year__.is_some() { + return Err(serde::de::Error::duplicate_field("blocksPerYear")); + } + blocks_per_year__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Params { + mint_denom: mint_denom__.unwrap_or_default(), + inflation_rate_change: inflation_rate_change__.unwrap_or_default(), + inflation_max: inflation_max__.unwrap_or_default(), + inflation_min: inflation_min__.unwrap_or_default(), + goal_bonded: goal_bonded__.unwrap_or_default(), + blocks_per_year: blocks_per_year__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAnnualProvisionsRequest { + #[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.mint.v1beta1.QueryAnnualProvisionsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsRequest { + #[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 = QueryAnnualProvisionsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryAnnualProvisionsRequest") + } + + 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(QueryAnnualProvisionsRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.QueryAnnualProvisionsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAnnualProvisionsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.mint.v1beta1.QueryAnnualProvisionsResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("annualProvisions", pbjson::private::base64::encode(&self.annual_provisions).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "annual_provisions", + "annualProvisions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AnnualProvisions, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "annualProvisions" | "annual_provisions" => Ok(GeneratedField::AnnualProvisions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAnnualProvisionsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryAnnualProvisionsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut annual_provisions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AnnualProvisions => { + if annual_provisions__.is_some() { + return Err(serde::de::Error::duplicate_field("annualProvisions")); + } + annual_provisions__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryAnnualProvisionsResponse { + annual_provisions: annual_provisions__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.QueryAnnualProvisionsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryInflationRequest { + #[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.mint.v1beta1.QueryInflationRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryInflationRequest { + #[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 = QueryInflationRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryInflationRequest") + } + + 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(QueryInflationRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.QueryInflationRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryInflationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.mint.v1beta1.QueryInflationResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("inflation", pbjson::private::base64::encode(&self.inflation).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryInflationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "inflation", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inflation, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "inflation" => Ok(GeneratedField::Inflation), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryInflationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryInflationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut inflation__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Inflation => { + if inflation__.is_some() { + return Err(serde::de::Error::duplicate_field("inflation")); + } + inflation__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryInflationResponse { + inflation: inflation__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.mint.v1beta1.QueryInflationResponse", 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.mint.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.mint.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.mint.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.mint.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.mint.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.mint.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs index ec21e2d7..72a666e1 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs @@ -394,3 +394,271 @@ pub mod query_server { const NAME: &'static str = "cosmos.mint.v1beta1.Query"; } } +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.mint.v1beta1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.mint.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.mint.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.mint.v1beta1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.module.v1.rs new file mode 100644 index 00000000..ecbc4b16 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.module.v1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the config object of the nft module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.module.v1.serde.rs new file mode 100644 index 00000000..cedeae00 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.nft.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.nft.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs index 9c48b679..43dde6e2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs @@ -2,32 +2,42 @@ /// EventSend is emitted on Msg/Send #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventSend { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the nft #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, + /// sender is the address of the owner of nft #[prost(string, tag = "3")] pub sender: ::prost::alloc::string::String, + /// receiver is the receiver address of nft #[prost(string, tag = "4")] pub receiver: ::prost::alloc::string::String, } /// EventMint is emitted on Mint #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventMint { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the nft #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, + /// owner is the owner address of the nft #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } /// EventBurn is emitted on Burn #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventBurn { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the nft #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, + /// owner is the owner address of the nft #[prost(string, tag = "3")] pub owner: ::prost::alloc::string::String, } @@ -54,7 +64,7 @@ pub struct Class { pub uri_hash: ::prost::alloc::string::String, /// data is the app specific metadata of the NFT class. Optional #[prost(message, optional, tag = "7")] - pub data: ::core::option::Option<::prost_types::Any>, + pub data: ::core::option::Option<::prost_wkt_types::Any>, } /// NFT defines the NFT. #[derive(Clone, PartialEq, ::prost::Message)] @@ -73,7 +83,7 @@ pub struct Nft { pub uri_hash: ::prost::alloc::string::String, /// data is an app specific data of the NFT. Optional #[prost(message, optional, tag = "10")] - pub data: ::core::option::Option<::prost_types::Any>, + pub data: ::core::option::Option<::prost_wkt_types::Any>, } /// GenesisState defines the nft module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] @@ -81,6 +91,7 @@ pub struct GenesisState { /// class defines the class of the nft type. #[prost(message, repeated, tag = "1")] pub classes: ::prost::alloc::vec::Vec, + /// entry defines all nft owned by a person. #[prost(message, repeated, tag = "2")] pub entries: ::prost::alloc::vec::Vec, } @@ -97,84 +108,102 @@ pub struct Entry { /// QueryBalanceRequest is the request type for the Query/Balance RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// owner is the owner address of the nft #[prost(string, tag = "2")] pub owner: ::prost::alloc::string::String, } /// QueryBalanceResponse is the response type for the Query/Balance RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { + /// amount is the number of all NFTs of a given class owned by the owner #[prost(uint64, tag = "1")] pub amount: u64, } /// QueryOwnerRequest is the request type for the Query/Owner RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOwnerRequest { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the NFT #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, } /// QueryOwnerResponse is the response type for the Query/Owner RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOwnerResponse { + /// owner is the owner address of the nft #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } /// QuerySupplyRequest is the request type for the Query/Supply RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyRequest { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, } /// QuerySupplyResponse is the response type for the Query/Supply RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyResponse { + /// amount is the number of all NFTs from the given class #[prost(uint64, tag = "1")] pub amount: u64, } /// QueryNFTstRequest is the request type for the Query/NFTs RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNfTsRequest { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// owner is the owner address of the nft #[prost(string, tag = "2")] pub owner: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } /// QueryNFTsResponse is the response type for the Query/NFTs RPC methods #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNfTsResponse { + /// NFT defines the NFT #[prost(message, repeated, tag = "1")] pub nfts: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryNFTRequest is the request type for the Query/NFT RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNftRequest { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the NFT #[prost(string, tag = "2")] pub id: ::prost::alloc::string::String, } /// QueryNFTResponse is the response type for the Query/NFT RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNftResponse { + /// owner is the owner address of the nft #[prost(message, optional, tag = "1")] pub nft: ::core::option::Option, } /// QueryClassRequest is the request type for the Query/Class RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassRequest { + /// class_id associated with the nft #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, } /// QueryClassResponse is the response type for the Query/Class RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassResponse { + /// class defines the class of the nft type. #[prost(message, optional, tag = "1")] pub class: ::core::option::Option, } @@ -188,8 +217,10 @@ pub struct QueryClassesRequest { /// QueryClassesResponse is the response type for the Query/Classes RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassesResponse { + /// class defines the class of the nft type. #[prost(message, repeated, tag = "1")] pub classes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.serde.rs new file mode 100644 index 00000000..2980392e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.serde.rs @@ -0,0 +1,2585 @@ +impl serde::Serialize for Class { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.nft.v1beta1.Class", len)?; + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if true { + struct_ser.serialize_field("symbol", &self.symbol)?; + } + if true { + struct_ser.serialize_field("description", &self.description)?; + } + if true { + struct_ser.serialize_field("uri", &self.uri)?; + } + if true { + struct_ser.serialize_field("uriHash", &self.uri_hash)?; + } + if let Some(v) = self.data.as_ref() { + struct_ser.serialize_field("data", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Class { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "name", + "symbol", + "description", + "uri", + "uri_hash", + "uriHash", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + Name, + Symbol, + Description, + Uri, + UriHash, + 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 { + "id" => Ok(GeneratedField::Id), + "name" => Ok(GeneratedField::Name), + "symbol" => Ok(GeneratedField::Symbol), + "description" => Ok(GeneratedField::Description), + "uri" => Ok(GeneratedField::Uri), + "uriHash" | "uri_hash" => Ok(GeneratedField::UriHash), + "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 = Class; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.Class") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut name__ = None; + let mut symbol__ = None; + let mut description__ = None; + let mut uri__ = None; + let mut uri_hash__ = None; + let mut data__ = 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::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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = 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()?); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = map_.next_value()?; + } + } + } + Ok(Class { + id: id__.unwrap_or_default(), + name: name__.unwrap_or_default(), + symbol: symbol__.unwrap_or_default(), + description: description__.unwrap_or_default(), + uri: uri__.unwrap_or_default(), + uri_hash: uri_hash__.unwrap_or_default(), + data: data__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.Class", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Entry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.Entry", len)?; + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + if true { + struct_ser.serialize_field("nfts", &self.nfts)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Entry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "owner", + "nfts", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + Nfts, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "nfts" => Ok(GeneratedField::Nfts), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Entry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.Entry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut owner__ = None; + let mut nfts__ = 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::Nfts => { + if nfts__.is_some() { + return Err(serde::de::Error::duplicate_field("nfts")); + } + nfts__ = Some(map_.next_value()?); + } + } + } + Ok(Entry { + owner: owner__.unwrap_or_default(), + nfts: nfts__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.Entry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventBurn { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.nft.v1beta1.EventBurn", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventBurn { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "id", + "owner", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + Owner, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "id" => Ok(GeneratedField::Id), + "owner" => Ok(GeneratedField::Owner), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventBurn; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.EventBurn") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + let mut owner__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + } + } + Ok(EventBurn { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + owner: owner__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.EventBurn", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventMint { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.nft.v1beta1.EventMint", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventMint { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "id", + "owner", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + Owner, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "id" => Ok(GeneratedField::Id), + "owner" => Ok(GeneratedField::Owner), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventMint; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.EventMint") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + let mut owner__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + } + } + Ok(EventMint { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + owner: owner__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.EventMint", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for EventSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.nft.v1beta1.EventSend", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for EventSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "id", + "sender", + "receiver", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + Sender, + Receiver, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "id" => Ok(GeneratedField::Id), + "sender" => Ok(GeneratedField::Sender), + "receiver" => Ok(GeneratedField::Receiver), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventSend; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.EventSend") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + let mut sender__ = None; + let mut receiver__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = 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()?); + } + } + } + Ok(EventSend { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + sender: sender__.unwrap_or_default(), + receiver: receiver__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.EventSend", 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.nft.v1beta1.GenesisState", len)?; + if true { + struct_ser.serialize_field("classes", &self.classes)?; + } + if true { + struct_ser.serialize_field("entries", &self.entries)?; + } + 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] = &[ + "classes", + "entries", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Classes, + 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 { + "classes" => Ok(GeneratedField::Classes), + "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 = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut classes__ = None; + let mut entries__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Classes => { + if classes__.is_some() { + return Err(serde::de::Error::duplicate_field("classes")); + } + classes__ = Some(map_.next_value()?); + } + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); + } + entries__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + classes: classes__.unwrap_or_default(), + entries: entries__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.GenesisState", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.MsgSend", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + 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] = &[ + "class_id", + "classId", + "id", + "sender", + "receiver", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + Sender, + Receiver, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "id" => Ok(GeneratedField::Id), + "sender" => Ok(GeneratedField::Sender), + "receiver" => Ok(GeneratedField::Receiver), + _ => 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.nft.v1beta1.MsgSend") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + let mut sender__ = None; + let mut receiver__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = 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()?); + } + } + } + Ok(MsgSend { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + sender: sender__.unwrap_or_default(), + receiver: receiver__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.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.nft.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.nft.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.nft.v1beta1.MsgSendResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Nft { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.nft.v1beta1.NFT", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("uri", &self.uri)?; + } + if true { + struct_ser.serialize_field("uriHash", &self.uri_hash)?; + } + if let Some(v) = self.data.as_ref() { + struct_ser.serialize_field("data", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Nft { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "id", + "uri", + "uri_hash", + "uriHash", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + Uri, + UriHash, + 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 { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "id" => Ok(GeneratedField::Id), + "uri" => Ok(GeneratedField::Uri), + "uriHash" | "uri_hash" => Ok(GeneratedField::UriHash), + "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 = Nft; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.NFT") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + let mut uri__ = None; + let mut uri_hash__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = 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()?); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = map_.next_value()?; + } + } + } + Ok(Nft { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + uri: uri__.unwrap_or_default(), + uri_hash: uri_hash__.unwrap_or_default(), + data: data__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.NFT", 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.nft.v1beta1.QueryBalanceRequest", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + 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] = &[ + "class_id", + "classId", + "owner", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Owner, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "owner" => Ok(GeneratedField::Owner), + _ => 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.nft.v1beta1.QueryBalanceRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut owner__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + } + } + Ok(QueryBalanceRequest { + class_id: class_id__.unwrap_or_default(), + owner: owner__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.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.nft.v1beta1.QueryBalanceResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("amount", ::alloc::string::ToString::to_string(&self.amount).as_str())?; + } + 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] = &[ + "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 = QueryBalanceResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryBalanceResponse") + } + + 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__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryBalanceResponse { + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryBalanceResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryClassRequest", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClassRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryClassRequest { + class_id: class_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryClassRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryClassResponse", len)?; + if let Some(v) = self.class.as_ref() { + struct_ser.serialize_field("class", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Class, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "class" => Ok(GeneratedField::Class), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClassResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Class => { + if class__.is_some() { + return Err(serde::de::Error::duplicate_field("class")); + } + class__ = map_.next_value()?; + } + } + } + Ok(QueryClassResponse { + class: class__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryClassResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryClassesRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassesRequest { + #[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 = QueryClassesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassesRequest") + } + + 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(QueryClassesRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryClassesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryClassesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryClassesResponse", len)?; + if true { + struct_ser.serialize_field("classes", &self.classes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryClassesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "classes", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Classes, + 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 { + "classes" => Ok(GeneratedField::Classes), + "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 = QueryClassesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut classes__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Classes => { + if classes__.is_some() { + return Err(serde::de::Error::duplicate_field("classes")); + } + classes__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryClassesResponse { + classes: classes__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryClassesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNftRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryNFTRequest", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNftRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "id", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + 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 { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "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 = QueryNftRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryNftRequest { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryNFTRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNftResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryNFTResponse", len)?; + if let Some(v) = self.nft.as_ref() { + struct_ser.serialize_field("nft", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNftResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "nft", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Nft, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "nft" => Ok(GeneratedField::Nft), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNftResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut nft__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Nft => { + if nft__.is_some() { + return Err(serde::de::Error::duplicate_field("nft")); + } + nft__ = map_.next_value()?; + } + } + } + Ok(QueryNftResponse { + nft: nft__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryNFTResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNfTsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.nft.v1beta1.QueryNFTsRequest", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNfTsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "owner", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Owner, + 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 { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "owner" => Ok(GeneratedField::Owner), + "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 = QueryNfTsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut owner__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Owner => { + if owner__.is_some() { + return Err(serde::de::Error::duplicate_field("owner")); + } + owner__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryNfTsRequest { + class_id: class_id__.unwrap_or_default(), + owner: owner__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryNFTsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNfTsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryNFTsResponse", len)?; + if true { + struct_ser.serialize_field("nfts", &self.nfts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNfTsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "nfts", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Nfts, + 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 { + "nfts" => Ok(GeneratedField::Nfts), + "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 = QueryNfTsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut nfts__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Nfts => { + if nfts__.is_some() { + return Err(serde::de::Error::duplicate_field("nfts")); + } + nfts__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryNfTsResponse { + nfts: nfts__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryNFTsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryOwnerRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryOwnerRequest", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryOwnerRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + "id", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + 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 { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + "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 = QueryOwnerRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryOwnerRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + let mut id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryOwnerRequest { + class_id: class_id__.unwrap_or_default(), + id: id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryOwnerRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryOwnerResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QueryOwnerResponse", len)?; + if true { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryOwnerResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "owner", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryOwnerResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryOwnerResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut owner__ = 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()?); + } + } + } + Ok(QueryOwnerResponse { + owner: owner__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QueryOwnerResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySupplyRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QuerySupplyRequest", len)?; + if true { + struct_ser.serialize_field("classId", &self.class_id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySupplyRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "class_id", + "classId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "classId" | "class_id" => Ok(GeneratedField::ClassId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QuerySupplyRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QuerySupplyRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut class_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClassId => { + if class_id__.is_some() { + return Err(serde::de::Error::duplicate_field("classId")); + } + class_id__ = Some(map_.next_value()?); + } + } + } + Ok(QuerySupplyRequest { + class_id: class_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QuerySupplyRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySupplyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.QuerySupplyResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("amount", ::alloc::string::ToString::to_string(&self.amount).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySupplyResponse { + #[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 = QuerySupplyResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QuerySupplyResponse") + } + + 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__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QuerySupplyResponse { + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.nft.v1beta1.QuerySupplyResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs new file mode 100644 index 00000000..0f8331f4 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.orm.module.v1alpha1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.module.v1alpha1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.orm.module.v1alpha1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.rs new file mode 100644 index 00000000..408c1e04 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.rs @@ -0,0 +1,135 @@ +// @generated +/// GetRequest is the Query/Get request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetRequest { + /// message_name is the fully-qualified message name of the ORM table being queried. + #[prost(string, tag = "1")] + pub message_name: ::prost::alloc::string::String, + /// index is the index fields expression used in orm definitions. If it + /// is empty, the table's primary key is assumed. If it is non-empty, it must + /// refer to an unique index. + #[prost(string, tag = "2")] + pub index: ::prost::alloc::string::String, + /// values are the values of the fields corresponding to the requested index. + /// There must be as many values provided as there are fields in the index and + /// these values must correspond to the index field types. + #[prost(message, repeated, tag = "3")] + pub values: ::prost::alloc::vec::Vec, +} +/// GetResponse is the Query/Get response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetResponse { + /// result is the result of the get query. If no value is found, the gRPC + /// status code NOT_FOUND will be returned. + #[prost(message, optional, tag = "1")] + pub result: ::core::option::Option<::prost_wkt_types::Any>, +} +/// ListRequest is the Query/List request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListRequest { + /// message_name is the fully-qualified message name of the ORM table being queried. + #[prost(string, tag = "1")] + pub message_name: ::prost::alloc::string::String, + /// index is the index fields expression used in orm definitions. If it + /// is empty, the table's primary key is assumed. + #[prost(string, tag = "2")] + pub index: ::prost::alloc::string::String, + /// pagination is the pagination request. + #[prost(message, optional, tag = "5")] + pub pagination: ::core::option::Option, + /// query is the query expression corresponding to the provided index. If + /// neither prefix nor range is specified, the query will list all the fields + /// in the index. + #[prost(oneof = "list_request::Query", tags = "3, 4")] + pub query: ::core::option::Option, +} +/// Nested message and enum types in `ListRequest`. +pub mod list_request { + /// Prefix specifies the arguments to a prefix query. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Prefix { + /// values specifies the index values for the prefix query. + /// It is valid to special a partial prefix with fewer values than + /// the number of fields in the index. + #[prost(message, repeated, tag = "1")] + pub values: ::prost::alloc::vec::Vec, + } + /// Range specifies the arguments to a range query. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Range { + /// start specifies the starting index values for the range query. + /// It is valid to provide fewer values than the number of fields in the + /// index. + #[prost(message, repeated, tag = "1")] + pub start: ::prost::alloc::vec::Vec, + /// end specifies the inclusive ending index values for the range query. + /// It is valid to provide fewer values than the number of fields in the + /// index. + #[prost(message, repeated, tag = "2")] + pub end: ::prost::alloc::vec::Vec, + } + /// query is the query expression corresponding to the provided index. If + /// neither prefix nor range is specified, the query will list all the fields + /// in the index. + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Query { + /// prefix defines a prefix query. + #[prost(message, tag = "3")] + Prefix(Prefix), + /// range defines a range query. + #[prost(message, tag = "4")] + Range(Range), + } +} +/// ListResponse is the Query/List response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListResponse { + /// results are the results of the query. + #[prost(message, repeated, tag = "1")] + pub results: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, + /// pagination is the pagination response. + #[prost(message, optional, tag = "5")] + pub pagination: ::core::option::Option, +} +/// IndexValue represents the value of a field in an ORM index expression. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IndexValue { + /// value specifies the index value + #[prost(oneof = "index_value::Value", tags = "1, 2, 3, 4, 5, 6, 7, 8")] + pub value: ::core::option::Option, +} +/// Nested message and enum types in `IndexValue`. +pub mod index_value { + /// value specifies the index value + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Value { + /// uint specifies a value for an uint32, fixed32, uint64, or fixed64 + /// index field. + #[prost(uint64, tag = "1")] + Uint(u64), + /// int64 specifies a value for an int32, sfixed32, int64, or sfixed64 + /// index field. + #[prost(int64, tag = "2")] + Int(i64), + /// str specifies a value for a string index field. + #[prost(string, tag = "3")] + Str(::prost::alloc::string::String), + /// bytes specifies a value for a bytes index field. + #[prost(bytes, tag = "4")] + Bytes(::prost::alloc::vec::Vec), + /// enum specifies a value for an enum index field. + #[prost(string, tag = "5")] + Enum(::prost::alloc::string::String), + /// bool specifies a value for a bool index field. + #[prost(bool, tag = "6")] + Bool(bool), + /// timestamp specifies a value for a timestamp index field. + #[prost(message, tag = "7")] + Timestamp(::prost_wkt_types::Timestamp), + /// duration specifies a value for a duration index field. + #[prost(message, tag = "8")] + Duration(::prost_wkt_types::Duration), + } +} +include!("cosmos.orm.query.v1alpha1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.serde.rs new file mode 100644 index 00000000..c1ce88bd --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.serde.rs @@ -0,0 +1,869 @@ +impl serde::Serialize for GetRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.orm.query.v1alpha1.GetRequest", len)?; + if true { + struct_ser.serialize_field("messageName", &self.message_name)?; + } + if true { + struct_ser.serialize_field("index", &self.index)?; + } + if true { + struct_ser.serialize_field("values", &self.values)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "message_name", + "messageName", + "index", + "values", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MessageName, + Index, + Values, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "messageName" | "message_name" => Ok(GeneratedField::MessageName), + "index" => Ok(GeneratedField::Index), + "values" => Ok(GeneratedField::Values), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.GetRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut message_name__ = None; + let mut index__ = None; + let mut values__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MessageName => { + if message_name__.is_some() { + return Err(serde::de::Error::duplicate_field("messageName")); + } + message_name__ = Some(map_.next_value()?); + } + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = Some(map_.next_value()?); + } + GeneratedField::Values => { + if values__.is_some() { + return Err(serde::de::Error::duplicate_field("values")); + } + values__ = Some(map_.next_value()?); + } + } + } + Ok(GetRequest { + message_name: message_name__.unwrap_or_default(), + index: index__.unwrap_or_default(), + values: values__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.GetRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.query.v1alpha1.GetResponse", len)?; + if let Some(v) = self.result.as_ref() { + struct_ser.serialize_field("result", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetResponse { + #[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 = GetResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.GetResponse") + } + + 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__ = map_.next_value()?; + } + } + } + Ok(GetResponse { + result: result__, + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.GetResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for IndexValue { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.value.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.query.v1alpha1.IndexValue", len)?; + if let Some(v) = self.value.as_ref() { + match v { + index_value::Value::Uint(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("uint", ::alloc::string::ToString::to_string(&v).as_str())?; + } + index_value::Value::Int(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("int", ::alloc::string::ToString::to_string(&v).as_str())?; + } + index_value::Value::Str(v) => { + struct_ser.serialize_field("str", v)?; + } + index_value::Value::Bytes(v) => { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("bytes", pbjson::private::base64::encode(&v).as_str())?; + } + index_value::Value::Enum(v) => { + struct_ser.serialize_field("enum", v)?; + } + index_value::Value::Bool(v) => { + struct_ser.serialize_field("bool", v)?; + } + index_value::Value::Timestamp(v) => { + struct_ser.serialize_field("timestamp", v)?; + } + index_value::Value::Duration(v) => { + struct_ser.serialize_field("duration", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for IndexValue { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "uint", + "int", + "str", + "bytes", + "enum", + "bool", + "timestamp", + "duration", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Uint, + Int, + Str, + Bytes, + Enum, + Bool, + Timestamp, + Duration, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "uint" => Ok(GeneratedField::Uint), + "int" => Ok(GeneratedField::Int), + "str" => Ok(GeneratedField::Str), + "bytes" => Ok(GeneratedField::Bytes), + "enum" => Ok(GeneratedField::Enum), + "bool" => Ok(GeneratedField::Bool), + "timestamp" => Ok(GeneratedField::Timestamp), + "duration" => Ok(GeneratedField::Duration), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = IndexValue; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.IndexValue") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Uint => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("uint")); + } + value__ = map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| index_value::Value::Uint(x.0)); + } + GeneratedField::Int => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("int")); + } + value__ = map_.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| index_value::Value::Int(x.0)); + } + GeneratedField::Str => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("str")); + } + value__ = map_.next_value::<::core::option::Option<_>>()?.map(index_value::Value::Str); + } + GeneratedField::Bytes => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("bytes")); + } + value__ = map_.next_value::<::core::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| index_value::Value::Bytes(x.0)); + } + GeneratedField::Enum => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("enum")); + } + value__ = map_.next_value::<::core::option::Option<_>>()?.map(index_value::Value::Enum); + } + GeneratedField::Bool => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("bool")); + } + value__ = map_.next_value::<::core::option::Option<_>>()?.map(index_value::Value::Bool); + } + GeneratedField::Timestamp => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + value__ = map_.next_value::<::core::option::Option<_>>()?.map(index_value::Value::Timestamp) +; + } + GeneratedField::Duration => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("duration")); + } + value__ = map_.next_value::<::core::option::Option<_>>()?.map(index_value::Value::Duration) +; + } + } + } + Ok(IndexValue { + value: value__, + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.IndexValue", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ListRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if self.query.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest", len)?; + if true { + struct_ser.serialize_field("messageName", &self.message_name)?; + } + if true { + struct_ser.serialize_field("index", &self.index)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.query.as_ref() { + match v { + list_request::Query::Prefix(v) => { + struct_ser.serialize_field("prefix", v)?; + } + list_request::Query::Range(v) => { + struct_ser.serialize_field("range", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ListRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "message_name", + "messageName", + "index", + "pagination", + "prefix", + "range", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MessageName, + Index, + Pagination, + Prefix, + Range, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "messageName" | "message_name" => Ok(GeneratedField::MessageName), + "index" => Ok(GeneratedField::Index), + "pagination" => Ok(GeneratedField::Pagination), + "prefix" => Ok(GeneratedField::Prefix), + "range" => Ok(GeneratedField::Range), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ListRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut message_name__ = None; + let mut index__ = None; + let mut pagination__ = None; + let mut query__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MessageName => { + if message_name__.is_some() { + return Err(serde::de::Error::duplicate_field("messageName")); + } + message_name__ = Some(map_.next_value()?); + } + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Prefix => { + if query__.is_some() { + return Err(serde::de::Error::duplicate_field("prefix")); + } + query__ = map_.next_value::<::core::option::Option<_>>()?.map(list_request::Query::Prefix) +; + } + GeneratedField::Range => { + if query__.is_some() { + return Err(serde::de::Error::duplicate_field("range")); + } + query__ = map_.next_value::<::core::option::Option<_>>()?.map(list_request::Query::Range) +; + } + } + } + Ok(ListRequest { + message_name: message_name__.unwrap_or_default(), + index: index__.unwrap_or_default(), + pagination: pagination__, + query: query__, + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.ListRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for list_request::Prefix { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Prefix", len)?; + if true { + struct_ser.serialize_field("values", &self.values)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for list_request::Prefix { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "values", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Values, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "values" => Ok(GeneratedField::Values), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = list_request::Prefix; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest.Prefix") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut values__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Values => { + if values__.is_some() { + return Err(serde::de::Error::duplicate_field("values")); + } + values__ = Some(map_.next_value()?); + } + } + } + Ok(list_request::Prefix { + values: values__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Prefix", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for list_request::Range { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Range", len)?; + if true { + struct_ser.serialize_field("start", &self.start)?; + } + if true { + struct_ser.serialize_field("end", &self.end)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for list_request::Range { + #[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 = list_request::Range; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest.Range") + } + + 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__ = Some(map_.next_value()?); + } + GeneratedField::End => { + if end__.is_some() { + return Err(serde::de::Error::duplicate_field("end")); + } + end__ = Some(map_.next_value()?); + } + } + } + Ok(list_request::Range { + start: start__.unwrap_or_default(), + end: end__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Range", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ListResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListResponse", len)?; + if true { + struct_ser.serialize_field("results", &self.results)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ListResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "results", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Results, + 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 { + "results" => Ok(GeneratedField::Results), + "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 = ListResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.query.v1alpha1.ListResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut results__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Results => { + if results__.is_some() { + return Err(serde::de::Error::duplicate_field("results")); + } + results__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(ListResponse { + results: results__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.orm.query.v1alpha1.ListResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.tonic.rs new file mode 100644 index 00000000..6fdeb470 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.tonic.rs @@ -0,0 +1,330 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn get( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.orm.query.v1alpha1.Query/Get"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.orm.query.v1alpha1.Query", "Get")); + self.inner.unary(req, path, codec).await + } + pub async fn list( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.orm.query.v1alpha1.Query/List"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.orm.query.v1alpha1.Query", "List")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn get( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn list( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.orm.query.v1alpha1.Query/Get" => { + #[allow(non_camel_case_types)] + struct GetSvc(pub Arc); + impl tonic::server::UnaryService for GetSvc { + type Response = super::GetResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.orm.query.v1alpha1.Query/List" => { + #[allow(non_camel_case_types)] + struct ListSvc(pub Arc); + impl tonic::server::UnaryService for ListSvc { + type Response = super::ListResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).list(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ListSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.orm.query.v1alpha1.Query"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs new file mode 100644 index 00000000..e3f5e721 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs @@ -0,0 +1,457 @@ +impl serde::Serialize for PrimaryKeyDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.v1.PrimaryKeyDescriptor", len)?; + if true { + struct_ser.serialize_field("fields", &self.fields)?; + } + if true { + struct_ser.serialize_field("autoIncrement", &self.auto_increment)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PrimaryKeyDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fields", + "auto_increment", + "autoIncrement", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fields, + AutoIncrement, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fields" => Ok(GeneratedField::Fields), + "autoIncrement" | "auto_increment" => Ok(GeneratedField::AutoIncrement), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PrimaryKeyDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.PrimaryKeyDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fields__ = None; + let mut auto_increment__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Fields => { + if fields__.is_some() { + return Err(serde::de::Error::duplicate_field("fields")); + } + fields__ = Some(map_.next_value()?); + } + GeneratedField::AutoIncrement => { + if auto_increment__.is_some() { + return Err(serde::de::Error::duplicate_field("autoIncrement")); + } + auto_increment__ = Some(map_.next_value()?); + } + } + } + Ok(PrimaryKeyDescriptor { + fields: fields__.unwrap_or_default(), + auto_increment: auto_increment__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.v1.PrimaryKeyDescriptor", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SecondaryIndexDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.orm.v1.SecondaryIndexDescriptor", len)?; + if true { + struct_ser.serialize_field("fields", &self.fields)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("unique", &self.unique)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SecondaryIndexDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fields", + "id", + "unique", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fields, + Id, + Unique, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fields" => Ok(GeneratedField::Fields), + "id" => Ok(GeneratedField::Id), + "unique" => Ok(GeneratedField::Unique), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SecondaryIndexDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.SecondaryIndexDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut fields__ = None; + let mut id__ = None; + let mut unique__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Fields => { + if fields__.is_some() { + return Err(serde::de::Error::duplicate_field("fields")); + } + fields__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Unique => { + if unique__.is_some() { + return Err(serde::de::Error::duplicate_field("unique")); + } + unique__ = Some(map_.next_value()?); + } + } + } + Ok(SecondaryIndexDescriptor { + fields: fields__.unwrap_or_default(), + id: id__.unwrap_or_default(), + unique: unique__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.v1.SecondaryIndexDescriptor", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SingletonDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.v1.SingletonDescriptor", len)?; + if true { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SingletonDescriptor { + #[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 = SingletonDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.SingletonDescriptor") + } + + 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::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SingletonDescriptor { + id: id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.v1.SingletonDescriptor", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TableDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.orm.v1.TableDescriptor", len)?; + if let Some(v) = self.primary_key.as_ref() { + struct_ser.serialize_field("primaryKey", v)?; + } + if true { + struct_ser.serialize_field("index", &self.index)?; + } + if true { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TableDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "primary_key", + "primaryKey", + "index", + "id", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PrimaryKey, + Index, + 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 { + "primaryKey" | "primary_key" => Ok(GeneratedField::PrimaryKey), + "index" => Ok(GeneratedField::Index), + "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 = TableDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.TableDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut primary_key__ = None; + let mut index__ = None; + let mut id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PrimaryKey => { + if primary_key__.is_some() { + return Err(serde::de::Error::duplicate_field("primaryKey")); + } + primary_key__ = map_.next_value()?; + } + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = Some(map_.next_value()?); + } + GeneratedField::Id => { + if id__.is_some() { + return Err(serde::de::Error::duplicate_field("id")); + } + id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(TableDescriptor { + primary_key: primary_key__, + index: index__.unwrap_or_default(), + id: id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.v1.TableDescriptor", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs new file mode 100644 index 00000000..734ec6de --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs @@ -0,0 +1,323 @@ +impl serde::Serialize for ModuleSchemaDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor", len)?; + if true { + struct_ser.serialize_field("schemaFile", &self.schema_file)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("prefix", pbjson::private::base64::encode(&self.prefix).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModuleSchemaDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "schema_file", + "schemaFile", + "prefix", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SchemaFile, + 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 { + "schemaFile" | "schema_file" => Ok(GeneratedField::SchemaFile), + "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 = ModuleSchemaDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.v1alpha1.ModuleSchemaDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut schema_file__ = None; + let mut prefix__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SchemaFile => { + if schema_file__.is_some() { + return Err(serde::de::Error::duplicate_field("schemaFile")); + } + schema_file__ = Some(map_.next_value()?); + } + GeneratedField::Prefix => { + if prefix__.is_some() { + return Err(serde::de::Error::duplicate_field("prefix")); + } + prefix__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ModuleSchemaDescriptor { + schema_file: schema_file__.unwrap_or_default(), + prefix: prefix__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for module_schema_descriptor::FileEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry", len)?; + if true { + struct_ser.serialize_field("id", &self.id)?; + } + if true { + struct_ser.serialize_field("protoFileName", &self.proto_file_name)?; + } + if true { + let v = StorageType::try_from(self.storage_type) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.storage_type)))?; + struct_ser.serialize_field("storageType", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for module_schema_descriptor::FileEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id", + "proto_file_name", + "protoFileName", + "storage_type", + "storageType", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + ProtoFileName, + StorageType, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "protoFileName" | "proto_file_name" => Ok(GeneratedField::ProtoFileName), + "storageType" | "storage_type" => Ok(GeneratedField::StorageType), + _ => 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_schema_descriptor::FileEntry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id__ = None; + let mut proto_file_name__ = None; + let mut storage_type__ = 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::ProtoFileName => { + if proto_file_name__.is_some() { + return Err(serde::de::Error::duplicate_field("protoFileName")); + } + proto_file_name__ = Some(map_.next_value()?); + } + GeneratedField::StorageType => { + if storage_type__.is_some() { + return Err(serde::de::Error::duplicate_field("storageType")); + } + storage_type__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(module_schema_descriptor::FileEntry { + id: id__.unwrap_or_default(), + proto_file_name: proto_file_name__.unwrap_or_default(), + storage_type: storage_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StorageType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", + Self::Memory => "STORAGE_TYPE_MEMORY", + Self::Transient => "STORAGE_TYPE_TRANSIENT", + Self::Index => "STORAGE_TYPE_INDEX", + Self::Commitment => "STORAGE_TYPE_COMMITMENT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for StorageType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STORAGE_TYPE_DEFAULT_UNSPECIFIED", + "STORAGE_TYPE_MEMORY", + "STORAGE_TYPE_TRANSIENT", + "STORAGE_TYPE_INDEX", + "STORAGE_TYPE_COMMITMENT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StorageType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Ok(StorageType::DefaultUnspecified), + "STORAGE_TYPE_MEMORY" => Ok(StorageType::Memory), + "STORAGE_TYPE_TRANSIENT" => Ok(StorageType::Transient), + "STORAGE_TYPE_INDEX" => Ok(StorageType::Index), + "STORAGE_TYPE_COMMITMENT" => Ok(StorageType::Commitment), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.module.v1.rs new file mode 100644 index 00000000..a4f871b5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.module.v1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the config object of the params module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.module.v1.serde.rs new file mode 100644 index 00000000..86e1b9a9 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.params.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.params.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.serde.rs new file mode 100644 index 00000000..d2c53b5b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.serde.rs @@ -0,0 +1,719 @@ +impl serde::Serialize for ParamChange { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.params.v1beta1.ParamChange", len)?; + if true { + struct_ser.serialize_field("subspace", &self.subspace)?; + } + if true { + struct_ser.serialize_field("key", &self.key)?; + } + if true { + struct_ser.serialize_field("value", &self.value)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ParamChange { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "subspace", + "key", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspace, + 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 { + "subspace" => Ok(GeneratedField::Subspace), + "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 = ParamChange; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.ParamChange") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut subspace__ = None; + let mut key__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Subspace => { + if subspace__.is_some() { + return Err(serde::de::Error::duplicate_field("subspace")); + } + subspace__ = Some(map_.next_value()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = Some(map_.next_value()?); + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = Some(map_.next_value()?); + } + } + } + Ok(ParamChange { + subspace: subspace__.unwrap_or_default(), + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.params.v1beta1.ParamChange", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ParameterChangeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.params.v1beta1.ParameterChangeProposal", 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("changes", &self.changes)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ParameterChangeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "changes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Changes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "changes" => Ok(GeneratedField::Changes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ParameterChangeProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.ParameterChangeProposal") + } + + 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 changes__ = 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::Changes => { + if changes__.is_some() { + return Err(serde::de::Error::duplicate_field("changes")); + } + changes__ = Some(map_.next_value()?); + } + } + } + Ok(ParameterChangeProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + changes: changes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.params.v1beta1.ParameterChangeProposal", 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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.params.v1beta1.QueryParamsRequest", len)?; + if true { + struct_ser.serialize_field("subspace", &self.subspace)?; + } + if true { + struct_ser.serialize_field("key", &self.key)?; + } + 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] = &[ + "subspace", + "key", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspace, + 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 { + "subspace" => Ok(GeneratedField::Subspace), + "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 = QueryParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut subspace__ = None; + let mut key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Subspace => { + if subspace__.is_some() { + return Err(serde::de::Error::duplicate_field("subspace")); + } + subspace__ = Some(map_.next_value()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = Some(map_.next_value()?); + } + } + } + Ok(QueryParamsRequest { + subspace: subspace__.unwrap_or_default(), + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.params.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.params.v1beta1.QueryParamsResponse", len)?; + if let Some(v) = self.param.as_ref() { + struct_ser.serialize_field("param", 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] = &[ + "param", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Param, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "param" => Ok(GeneratedField::Param), + _ => 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.params.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut param__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Param => { + if param__.is_some() { + return Err(serde::de::Error::duplicate_field("param")); + } + param__ = map_.next_value()?; + } + } + } + Ok(QueryParamsResponse { + param: param__, + }) + } + } + deserializer.deserialize_struct("cosmos.params.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySubspacesRequest { + #[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.params.v1beta1.QuerySubspacesRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySubspacesRequest { + #[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 = QuerySubspacesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QuerySubspacesRequest") + } + + 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(QuerySubspacesRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.params.v1beta1.QuerySubspacesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySubspacesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.params.v1beta1.QuerySubspacesResponse", len)?; + if true { + struct_ser.serialize_field("subspaces", &self.subspaces)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySubspacesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "subspaces", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspaces, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "subspaces" => Ok(GeneratedField::Subspaces), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QuerySubspacesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QuerySubspacesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut subspaces__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Subspaces => { + if subspaces__.is_some() { + return Err(serde::de::Error::duplicate_field("subspaces")); + } + subspaces__ = Some(map_.next_value()?); + } + } + } + Ok(QuerySubspacesResponse { + subspaces: subspaces__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.params.v1beta1.QuerySubspacesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Subspace { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.params.v1beta1.Subspace", len)?; + if true { + struct_ser.serialize_field("subspace", &self.subspace)?; + } + if true { + struct_ser.serialize_field("keys", &self.keys)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Subspace { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "subspace", + "keys", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspace, + 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 { + "subspace" => Ok(GeneratedField::Subspace), + "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 = Subspace; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.Subspace") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut subspace__ = None; + let mut keys__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Subspace => { + if subspace__.is_some() { + return Err(serde::de::Error::duplicate_field("subspace")); + } + subspace__ = Some(map_.next_value()?); + } + GeneratedField::Keys => { + if keys__.is_some() { + return Err(serde::de::Error::duplicate_field("keys")); + } + keys__ = Some(map_.next_value()?); + } + } + } + Ok(Subspace { + subspace: subspace__.unwrap_or_default(), + keys: keys__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.params.v1beta1.Subspace", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.query.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.query.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.query.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.rs new file mode 100644 index 00000000..406adb1b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.rs @@ -0,0 +1,13 @@ +// @generated +/// FileDescriptorsRequest is the Query/FileDescriptors request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FileDescriptorsRequest {} +/// FileDescriptorsResponse is the Query/FileDescriptors response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FileDescriptorsResponse { + /// files is the file descriptors. + #[prost(message, repeated, tag = "1")] + pub files: ::prost::alloc::vec::Vec<::prost_wkt_types::FileDescriptorProto>, +} +include!("cosmos.reflection.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.serde.rs new file mode 100644 index 00000000..05695132 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.serde.rs @@ -0,0 +1,162 @@ +impl serde::Serialize for FileDescriptorsRequest { + #[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.reflection.v1.FileDescriptorsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileDescriptorsRequest { + #[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 = FileDescriptorsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.reflection.v1.FileDescriptorsRequest") + } + + 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(FileDescriptorsRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.reflection.v1.FileDescriptorsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FileDescriptorsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.reflection.v1.FileDescriptorsResponse", len)?; + if true { + struct_ser.serialize_field("files", &self.files)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FileDescriptorsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "files", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Files, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "files" => Ok(GeneratedField::Files), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FileDescriptorsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.reflection.v1.FileDescriptorsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut files__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Files => { + if files__.is_some() { + return Err(serde::de::Error::duplicate_field("files")); + } + files__ = Some(map_.next_value()?); + } + } + } + Ok(FileDescriptorsResponse { + files: files__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.reflection.v1.FileDescriptorsResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs new file mode 100644 index 00000000..ba089514 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs @@ -0,0 +1,290 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod reflection_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + /** Package cosmos.reflection.v1 provides support for inspecting protobuf + file descriptors. + */ + #[derive(Debug, Clone)] + pub struct ReflectionServiceClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl ReflectionServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ReflectionServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> ReflectionServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + ReflectionServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /** FileDescriptors queries all the file descriptors in the app in order + to enable easier generation of dynamic clients. + */ + pub async fn file_descriptors( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.reflection.v1.ReflectionService/FileDescriptors", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.reflection.v1.ReflectionService", + "FileDescriptors", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod reflection_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ReflectionServiceServer. + #[async_trait] + pub trait ReflectionService: Send + Sync + 'static { + /** FileDescriptors queries all the file descriptors in the app in order + to enable easier generation of dynamic clients. + */ + async fn file_descriptors( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + /** Package cosmos.reflection.v1 provides support for inspecting protobuf + file descriptors. + */ + #[derive(Debug)] + pub struct ReflectionServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ReflectionServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for ReflectionServiceServer + where + T: ReflectionService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.reflection.v1.ReflectionService/FileDescriptors" => { + #[allow(non_camel_case_types)] + struct FileDescriptorsSvc(pub Arc); + impl + tonic::server::UnaryService + for FileDescriptorsSvc + { + type Response = super::FileDescriptorsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).file_descriptors(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FileDescriptorsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for ReflectionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ReflectionServiceServer { + const NAME: &'static str = "cosmos.reflection.v1.ReflectionService"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.module.v1.rs new file mode 100644 index 00000000..ce79e696 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.module.v1.rs @@ -0,0 +1,9 @@ +// @generated +/// Module is the config object of the slashing module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.module.v1.serde.rs new file mode 100644 index 00000000..baa2bfe5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.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.slashing.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.slashing.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.slashing.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs index 31d12936..fc05ca5b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs @@ -15,7 +15,7 @@ pub struct ValidatorSigningInfo { pub index_offset: i64, /// Timestamp until which the validator is jailed due to liveness downtime. #[prost(message, optional, tag = "4")] - pub jailed_until: ::core::option::Option<::prost_types::Timestamp>, + pub jailed_until: ::core::option::Option<::prost_wkt_types::Timestamp>, /// Whether or not a validator has been tombstoned (killed out of validator set). It is set /// once the validator commits an equivocation or for any other configured misbehiavor. #[prost(bool, tag = "5")] @@ -33,7 +33,7 @@ pub struct Params { #[prost(bytes = "vec", tag = "2")] pub min_signed_per_window: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] - pub downtime_jail_duration: ::core::option::Option<::prost_types::Duration>, + pub downtime_jail_duration: ::core::option::Option<::prost_wkt_types::Duration>, #[prost(bytes = "vec", tag = "4")] pub slash_fraction_double_sign: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "5")] @@ -42,7 +42,7 @@ pub struct Params { /// GenesisState defines the slashing module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { - /// params defines all the paramaters of related to deposit. + /// params defines all the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// signing_infos represents a map between validator addresses and their @@ -136,5 +136,25 @@ pub struct MsgUnjail { /// MsgUnjailResponse defines the Msg/Unjail response type #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnjailResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/slashing parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("cosmos.slashing.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.serde.rs new file mode 100644 index 00000000..24ec6246 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.serde.rs @@ -0,0 +1,1708 @@ +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("cosmos.slashing.v1beta1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if true { + struct_ser.serialize_field("signingInfos", &self.signing_infos)?; + } + if true { + struct_ser.serialize_field("missedBlocks", &self.missed_blocks)?; + } + 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", + "signing_infos", + "signingInfos", + "missed_blocks", + "missedBlocks", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + SigningInfos, + MissedBlocks, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "signingInfos" | "signing_infos" => Ok(GeneratedField::SigningInfos), + "missedBlocks" | "missed_blocks" => Ok(GeneratedField::MissedBlocks), + _ => 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.slashing.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut signing_infos__ = None; + let mut missed_blocks__ = 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::SigningInfos => { + if signing_infos__.is_some() { + return Err(serde::de::Error::duplicate_field("signingInfos")); + } + signing_infos__ = Some(map_.next_value()?); + } + GeneratedField::MissedBlocks => { + if missed_blocks__.is_some() { + return Err(serde::de::Error::duplicate_field("missedBlocks")); + } + missed_blocks__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + signing_infos: signing_infos__.unwrap_or_default(), + missed_blocks: missed_blocks__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MissedBlock { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.MissedBlock", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ::alloc::string::ToString::to_string(&self.index).as_str())?; + } + if true { + struct_ser.serialize_field("missed", &self.missed)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MissedBlock { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "index", + "missed", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + Missed, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "index" => Ok(GeneratedField::Index), + "missed" => Ok(GeneratedField::Missed), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MissedBlock; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.MissedBlock") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut index__ = None; + let mut missed__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Index => { + if index__.is_some() { + return Err(serde::de::Error::duplicate_field("index")); + } + index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Missed => { + if missed__.is_some() { + return Err(serde::de::Error::duplicate_field("missed")); + } + missed__ = Some(map_.next_value()?); + } + } + } + Ok(MissedBlock { + index: index__.unwrap_or_default(), + missed: missed__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.MissedBlock", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUnjail { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.MsgUnjail", len)?; + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUnjail { + #[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 = MsgUnjail; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.MsgUnjail") + } + + 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(MsgUnjail { + validator_addr: validator_addr__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.MsgUnjail", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUnjailResponse { + #[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.slashing.v1beta1.MsgUnjailResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUnjailResponse { + #[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 = MsgUnjailResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.MsgUnjailResponse") + } + + 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(MsgUnjailResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.MsgUnjailResponse", 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.slashing.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.slashing.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.slashing.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.slashing.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.slashing.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.slashing.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.slashing.v1beta1.Params", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signedBlocksWindow", ::alloc::string::ToString::to_string(&self.signed_blocks_window).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("minSignedPerWindow", pbjson::private::base64::encode(&self.min_signed_per_window).as_str())?; + } + if let Some(v) = self.downtime_jail_duration.as_ref() { + struct_ser.serialize_field("downtimeJailDuration", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("slashFractionDoubleSign", pbjson::private::base64::encode(&self.slash_fraction_double_sign).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("slashFractionDowntime", pbjson::private::base64::encode(&self.slash_fraction_downtime).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] = &[ + "signed_blocks_window", + "signedBlocksWindow", + "min_signed_per_window", + "minSignedPerWindow", + "downtime_jail_duration", + "downtimeJailDuration", + "slash_fraction_double_sign", + "slashFractionDoubleSign", + "slash_fraction_downtime", + "slashFractionDowntime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignedBlocksWindow, + MinSignedPerWindow, + DowntimeJailDuration, + SlashFractionDoubleSign, + SlashFractionDowntime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signedBlocksWindow" | "signed_blocks_window" => Ok(GeneratedField::SignedBlocksWindow), + "minSignedPerWindow" | "min_signed_per_window" => Ok(GeneratedField::MinSignedPerWindow), + "downtimeJailDuration" | "downtime_jail_duration" => Ok(GeneratedField::DowntimeJailDuration), + "slashFractionDoubleSign" | "slash_fraction_double_sign" => Ok(GeneratedField::SlashFractionDoubleSign), + "slashFractionDowntime" | "slash_fraction_downtime" => Ok(GeneratedField::SlashFractionDowntime), + _ => 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.slashing.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signed_blocks_window__ = None; + let mut min_signed_per_window__ = None; + let mut downtime_jail_duration__ = None; + let mut slash_fraction_double_sign__ = None; + let mut slash_fraction_downtime__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SignedBlocksWindow => { + if signed_blocks_window__.is_some() { + return Err(serde::de::Error::duplicate_field("signedBlocksWindow")); + } + signed_blocks_window__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::MinSignedPerWindow => { + if min_signed_per_window__.is_some() { + return Err(serde::de::Error::duplicate_field("minSignedPerWindow")); + } + min_signed_per_window__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::DowntimeJailDuration => { + if downtime_jail_duration__.is_some() { + return Err(serde::de::Error::duplicate_field("downtimeJailDuration")); + } + downtime_jail_duration__ = map_.next_value()?; + } + GeneratedField::SlashFractionDoubleSign => { + if slash_fraction_double_sign__.is_some() { + return Err(serde::de::Error::duplicate_field("slashFractionDoubleSign")); + } + slash_fraction_double_sign__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::SlashFractionDowntime => { + if slash_fraction_downtime__.is_some() { + return Err(serde::de::Error::duplicate_field("slashFractionDowntime")); + } + slash_fraction_downtime__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(Params { + signed_blocks_window: signed_blocks_window__.unwrap_or_default(), + min_signed_per_window: min_signed_per_window__.unwrap_or_default(), + downtime_jail_duration: downtime_jail_duration__, + slash_fraction_double_sign: slash_fraction_double_sign__.unwrap_or_default(), + slash_fraction_downtime: slash_fraction_downtime__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.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("cosmos.slashing.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.slashing.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.slashing.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.slashing.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.slashing.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.slashing.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySigningInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.QuerySigningInfoRequest", len)?; + if true { + struct_ser.serialize_field("consAddress", &self.cons_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySigningInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "cons_address", + "consAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "consAddress" | "cons_address" => Ok(GeneratedField::ConsAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QuerySigningInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut cons_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsAddress => { + if cons_address__.is_some() { + return Err(serde::de::Error::duplicate_field("consAddress")); + } + cons_address__ = Some(map_.next_value()?); + } + } + } + Ok(QuerySigningInfoRequest { + cons_address: cons_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.QuerySigningInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySigningInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.QuerySigningInfoResponse", len)?; + if let Some(v) = self.val_signing_info.as_ref() { + struct_ser.serialize_field("valSigningInfo", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySigningInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "val_signing_info", + "valSigningInfo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValSigningInfo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "valSigningInfo" | "val_signing_info" => Ok(GeneratedField::ValSigningInfo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QuerySigningInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut val_signing_info__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValSigningInfo => { + if val_signing_info__.is_some() { + return Err(serde::de::Error::duplicate_field("valSigningInfo")); + } + val_signing_info__ = map_.next_value()?; + } + } + } + Ok(QuerySigningInfoResponse { + val_signing_info: val_signing_info__, + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.QuerySigningInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySigningInfosRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.QuerySigningInfosRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySigningInfosRequest { + #[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 = QuerySigningInfosRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfosRequest") + } + + 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(QuerySigningInfosRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.QuerySigningInfosRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySigningInfosResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.QuerySigningInfosResponse", len)?; + if true { + struct_ser.serialize_field("info", &self.info)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySigningInfosResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "info", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Info, + 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 { + "info" => Ok(GeneratedField::Info), + "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 = QuerySigningInfosResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfosResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut info__ = None; + let mut pagination__ = 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__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QuerySigningInfosResponse { + info: info__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.QuerySigningInfosResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SigningInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.SigningInfo", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.validator_signing_info.as_ref() { + struct_ser.serialize_field("validatorSigningInfo", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SigningInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "validator_signing_info", + "validatorSigningInfo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + ValidatorSigningInfo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "validatorSigningInfo" | "validator_signing_info" => Ok(GeneratedField::ValidatorSigningInfo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SigningInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.SigningInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut validator_signing_info__ = 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::ValidatorSigningInfo => { + if validator_signing_info__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSigningInfo")); + } + validator_signing_info__ = map_.next_value()?; + } + } + } + Ok(SigningInfo { + address: address__.unwrap_or_default(), + validator_signing_info: validator_signing_info__, + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.SigningInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorMissedBlocks { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.ValidatorMissedBlocks", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + struct_ser.serialize_field("missedBlocks", &self.missed_blocks)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorMissedBlocks { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "missed_blocks", + "missedBlocks", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + MissedBlocks, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "missedBlocks" | "missed_blocks" => Ok(GeneratedField::MissedBlocks), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorMissedBlocks; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.ValidatorMissedBlocks") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut missed_blocks__ = 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::MissedBlocks => { + if missed_blocks__.is_some() { + return Err(serde::de::Error::duplicate_field("missedBlocks")); + } + missed_blocks__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorMissedBlocks { + address: address__.unwrap_or_default(), + missed_blocks: missed_blocks__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.ValidatorMissedBlocks", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorSigningInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.slashing.v1beta1.ValidatorSigningInfo", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startHeight", ::alloc::string::ToString::to_string(&self.start_height).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("indexOffset", ::alloc::string::ToString::to_string(&self.index_offset).as_str())?; + } + if let Some(v) = self.jailed_until.as_ref() { + struct_ser.serialize_field("jailedUntil", v)?; + } + if true { + struct_ser.serialize_field("tombstoned", &self.tombstoned)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("missedBlocksCounter", ::alloc::string::ToString::to_string(&self.missed_blocks_counter).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorSigningInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "start_height", + "startHeight", + "index_offset", + "indexOffset", + "jailed_until", + "jailedUntil", + "tombstoned", + "missed_blocks_counter", + "missedBlocksCounter", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + StartHeight, + IndexOffset, + JailedUntil, + Tombstoned, + MissedBlocksCounter, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "startHeight" | "start_height" => Ok(GeneratedField::StartHeight), + "indexOffset" | "index_offset" => Ok(GeneratedField::IndexOffset), + "jailedUntil" | "jailed_until" => Ok(GeneratedField::JailedUntil), + "tombstoned" => Ok(GeneratedField::Tombstoned), + "missedBlocksCounter" | "missed_blocks_counter" => Ok(GeneratedField::MissedBlocksCounter), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorSigningInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.ValidatorSigningInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut start_height__ = None; + let mut index_offset__ = None; + let mut jailed_until__ = None; + let mut tombstoned__ = None; + let mut missed_blocks_counter__ = 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::StartHeight => { + if start_height__.is_some() { + return Err(serde::de::Error::duplicate_field("startHeight")); + } + start_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::IndexOffset => { + if index_offset__.is_some() { + return Err(serde::de::Error::duplicate_field("indexOffset")); + } + index_offset__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::JailedUntil => { + if jailed_until__.is_some() { + return Err(serde::de::Error::duplicate_field("jailedUntil")); + } + jailed_until__ = map_.next_value()?; + } + GeneratedField::Tombstoned => { + if tombstoned__.is_some() { + return Err(serde::de::Error::duplicate_field("tombstoned")); + } + tombstoned__ = Some(map_.next_value()?); + } + GeneratedField::MissedBlocksCounter => { + if missed_blocks_counter__.is_some() { + return Err(serde::de::Error::duplicate_field("missedBlocksCounter")); + } + missed_blocks_counter__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ValidatorSigningInfo { + address: address__.unwrap_or_default(), + start_height: start_height__.unwrap_or_default(), + index_offset: index_offset__.unwrap_or_default(), + jailed_until: jailed_until__, + tombstoned: tombstoned__.unwrap_or_default(), + missed_blocks_counter: missed_blocks_counter__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.slashing.v1beta1.ValidatorSigningInfo", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs index 6c483a4f..518782ed 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs @@ -496,6 +496,27 @@ pub mod msg_client { .insert(GrpcMethod::new("cosmos.slashing.v1beta1.Msg", "Unjail")); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.slashing.v1beta1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.slashing.v1beta1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -510,6 +531,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -625,6 +650,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.slashing.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs new file mode 100644 index 00000000..c2457c21 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs @@ -0,0 +1,14 @@ +// @generated +/// Module is the config object of the staking module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// hooks_order specifies the order of staking hooks and should be a list + /// of module names which provide a staking hooks instance. If no order is + /// provided, then hooks will be applied in alphabetical order of module names. + #[prost(string, repeated, tag = "1")] + pub hooks_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.serde.rs new file mode 100644 index 00000000..f9224074 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs index 0695b59e..58f5b500 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs @@ -97,7 +97,7 @@ pub struct Commission { pub commission_rates: ::core::option::Option, /// update_time is the last time the commission rate was changed. #[prost(message, optional, tag = "2")] - pub update_time: ::core::option::Option<::prost_types::Timestamp>, + pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// Description defines a validator description. #[derive(Clone, PartialEq, ::prost::Message)] @@ -133,7 +133,7 @@ pub struct Validator { pub operator_address: ::prost::alloc::string::String, /// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. #[prost(message, optional, tag = "2")] - pub consensus_pubkey: ::core::option::Option<::prost_types::Any>, + pub consensus_pubkey: ::core::option::Option<::prost_wkt_types::Any>, /// jailed defined whether the validator has been jailed from bonded status or not. #[prost(bool, tag = "3")] pub jailed: bool, @@ -154,7 +154,7 @@ pub struct Validator { pub unbonding_height: i64, /// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. #[prost(message, optional, tag = "9")] - pub unbonding_time: ::core::option::Option<::prost_types::Timestamp>, + pub unbonding_time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// commission defines the commission parameters. #[prost(message, optional, tag = "10")] pub commission: ::core::option::Option, @@ -163,6 +163,12 @@ pub struct Validator { /// Since: cosmos-sdk 0.46 #[prost(string, tag = "11")] pub min_self_delegation: ::prost::alloc::string::String, + /// strictly positive if this validator's unbonding has been stopped by external modules + #[prost(int64, tag = "12")] + pub unbonding_on_hold_ref_count: i64, + /// list of unbonding ids, each uniquely identifing an unbonding of this validator + #[prost(uint64, repeated, tag = "13")] + pub unbonding_ids: ::prost::alloc::vec::Vec, } /// ValAddresses defines a repeated set of validator addresses. #[derive(Clone, PartialEq, ::prost::Message)] @@ -244,13 +250,19 @@ pub struct UnbondingDelegationEntry { pub creation_height: i64, /// completion_time is the unix time for unbonding completion. #[prost(message, optional, tag = "2")] - pub completion_time: ::core::option::Option<::prost_types::Timestamp>, + pub completion_time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// initial_balance defines the tokens initially scheduled to receive at completion. #[prost(string, tag = "3")] pub initial_balance: ::prost::alloc::string::String, /// balance defines the tokens to receive at completion. #[prost(string, tag = "4")] pub balance: ::prost::alloc::string::String, + /// Incrementing id that uniquely identifies this entry + #[prost(uint64, tag = "5")] + pub unbonding_id: u64, + /// Strictly positive if this entry's unbonding has been stopped by external modules + #[prost(int64, tag = "6")] + pub unbonding_on_hold_ref_count: i64, } /// RedelegationEntry defines a redelegation object with relevant metadata. #[derive(Clone, PartialEq, ::prost::Message)] @@ -260,13 +272,19 @@ pub struct RedelegationEntry { pub creation_height: i64, /// completion_time defines the unix time for redelegation completion. #[prost(message, optional, tag = "2")] - pub completion_time: ::core::option::Option<::prost_types::Timestamp>, + pub completion_time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// initial_balance defines the initial balance when redelegation started. #[prost(string, tag = "3")] pub initial_balance: ::prost::alloc::string::String, /// shares_dst is the amount of destination-validator shares created by redelegation. #[prost(string, tag = "4")] pub shares_dst: ::prost::alloc::string::String, + /// Incrementing id that uniquely identifies this entry + #[prost(uint64, tag = "5")] + pub unbonding_id: u64, + /// Strictly positive if this entry's unbonding has been stopped by external modules + #[prost(int64, tag = "6")] + pub unbonding_on_hold_ref_count: i64, } /// Redelegation contains the list of a particular delegator's redelegating bonds /// from a particular source validator to a particular destination validator. @@ -287,12 +305,12 @@ pub struct Redelegation { #[prost(message, repeated, tag = "4")] pub entries: ::prost::alloc::vec::Vec, } -/// Params defines the parameters for the staking module. +/// Params defines the parameters for the x/staking module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// unbonding_time is the time duration of unbonding. #[prost(message, optional, tag = "1")] - pub unbonding_time: ::core::option::Option<::prost_types::Duration>, + pub unbonding_time: ::core::option::Option<::prost_wkt_types::Duration>, /// max_validators is the maximum number of validators. #[prost(uint32, tag = "2")] pub max_validators: u32, @@ -347,6 +365,13 @@ pub struct Pool { #[prost(string, tag = "2")] pub bonded_tokens: ::prost::alloc::string::String, } +/// ValidatorUpdates defines an array of abci.ValidatorUpdate objects. +/// TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ValidatorUpdates { + #[prost(message, repeated, tag = "1")] + pub updates: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::ValidatorUpdate>, +} /// BondStatus is the status of a validator. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -374,10 +399,34 @@ impl BondStatus { } } } +/// Infraction indicates the infraction a validator commited. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Infraction { + /// UNSPECIFIED defines an empty infraction. + Unspecified = 0, + /// DOUBLE_SIGN defines a validator that double-signs a block. + DoubleSign = 1, + /// DOWNTIME defines a validator that missed signing too many blocks. + Downtime = 2, +} +impl Infraction { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Infraction::Unspecified => "INFRACTION_UNSPECIFIED", + Infraction::DoubleSign => "INFRACTION_DOUBLE_SIGN", + Infraction::Downtime => "INFRACTION_DOWNTIME", + } + } +} /// GenesisState defines the staking module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { - /// params defines all the paramaters of related to deposit. + /// params defines all the parameters of related to deposit. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, /// last_total_power tracks the total amounts of bonded tokens recorded during @@ -686,7 +735,7 @@ pub struct MsgCreateValidator { #[prost(string, tag = "5")] pub validator_address: ::prost::alloc::string::String, #[prost(message, optional, tag = "6")] - pub pubkey: ::core::option::Option<::prost_types::Any>, + pub pubkey: ::core::option::Option<::prost_wkt_types::Any>, #[prost(message, optional, tag = "7")] pub value: ::core::option::Option, } @@ -743,7 +792,7 @@ pub struct MsgBeginRedelegate { #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBeginRedelegateResponse { #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option<::prost_types::Timestamp>, + pub completion_time: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// MsgUndelegate defines a SDK message for performing an undelegation from a /// delegate and a validator. @@ -760,7 +809,7 @@ pub struct MsgUndelegate { #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUndelegateResponse { #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option<::prost_types::Timestamp>, + pub completion_time: ::core::option::Option<::prost_wkt_types::Timestamp>, } /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator /// @@ -783,5 +832,25 @@ pub struct MsgCancelUnbondingDelegation { /// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegationResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/staking parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("cosmos.staking.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs new file mode 100644 index 00000000..4883dfc1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs @@ -0,0 +1,8009 @@ +impl serde::Serialize for AuthorizationType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED", + Self::Delegate => "AUTHORIZATION_TYPE_DELEGATE", + Self::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", + Self::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for AuthorizationType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "AUTHORIZATION_TYPE_UNSPECIFIED", + "AUTHORIZATION_TYPE_DELEGATE", + "AUTHORIZATION_TYPE_UNDELEGATE", + "AUTHORIZATION_TYPE_REDELEGATE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AuthorizationType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "AUTHORIZATION_TYPE_UNSPECIFIED" => Ok(AuthorizationType::Unspecified), + "AUTHORIZATION_TYPE_DELEGATE" => Ok(AuthorizationType::Delegate), + "AUTHORIZATION_TYPE_UNDELEGATE" => Ok(AuthorizationType::Undelegate), + "AUTHORIZATION_TYPE_REDELEGATE" => Ok(AuthorizationType::Redelegate), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for BondStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "BOND_STATUS_UNSPECIFIED", + Self::Unbonded => "BOND_STATUS_UNBONDED", + Self::Unbonding => "BOND_STATUS_UNBONDING", + Self::Bonded => "BOND_STATUS_BONDED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for BondStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "BOND_STATUS_UNSPECIFIED", + "BOND_STATUS_UNBONDED", + "BOND_STATUS_UNBONDING", + "BOND_STATUS_BONDED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BondStatus; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "BOND_STATUS_UNSPECIFIED" => Ok(BondStatus::Unspecified), + "BOND_STATUS_UNBONDED" => Ok(BondStatus::Unbonded), + "BOND_STATUS_UNBONDING" => Ok(BondStatus::Unbonding), + "BOND_STATUS_BONDED" => Ok(BondStatus::Bonded), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for Commission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Commission", len)?; + if let Some(v) = self.commission_rates.as_ref() { + struct_ser.serialize_field("commissionRates", v)?; + } + if let Some(v) = self.update_time.as_ref() { + struct_ser.serialize_field("updateTime", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Commission { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "commission_rates", + "commissionRates", + "update_time", + "updateTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CommissionRates, + UpdateTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "commissionRates" | "commission_rates" => Ok(GeneratedField::CommissionRates), + "updateTime" | "update_time" => Ok(GeneratedField::UpdateTime), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Commission; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Commission") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commission_rates__ = None; + let mut update_time__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CommissionRates => { + if commission_rates__.is_some() { + return Err(serde::de::Error::duplicate_field("commissionRates")); + } + commission_rates__ = map_.next_value()?; + } + GeneratedField::UpdateTime => { + if update_time__.is_some() { + return Err(serde::de::Error::duplicate_field("updateTime")); + } + update_time__ = map_.next_value()?; + } + } + } + Ok(Commission { + commission_rates: commission_rates__, + update_time: update_time__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Commission", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CommissionRates { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.CommissionRates", len)?; + if true { + struct_ser.serialize_field("rate", &self.rate)?; + } + if true { + struct_ser.serialize_field("maxRate", &self.max_rate)?; + } + if true { + struct_ser.serialize_field("maxChangeRate", &self.max_change_rate)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CommissionRates { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "rate", + "max_rate", + "maxRate", + "max_change_rate", + "maxChangeRate", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rate, + MaxRate, + MaxChangeRate, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "rate" => Ok(GeneratedField::Rate), + "maxRate" | "max_rate" => Ok(GeneratedField::MaxRate), + "maxChangeRate" | "max_change_rate" => Ok(GeneratedField::MaxChangeRate), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CommissionRates; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.CommissionRates") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut rate__ = None; + let mut max_rate__ = None; + let mut max_change_rate__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Rate => { + if rate__.is_some() { + return Err(serde::de::Error::duplicate_field("rate")); + } + rate__ = Some(map_.next_value()?); + } + GeneratedField::MaxRate => { + if max_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("maxRate")); + } + max_rate__ = Some(map_.next_value()?); + } + GeneratedField::MaxChangeRate => { + if max_change_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("maxChangeRate")); + } + max_change_rate__ = Some(map_.next_value()?); + } + } + } + Ok(CommissionRates { + rate: rate__.unwrap_or_default(), + max_rate: max_rate__.unwrap_or_default(), + max_change_rate: max_change_rate__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.CommissionRates", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DvPair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVPair", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DvPair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DvPair; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVPair") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + } + } + Ok(DvPair { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.DVPair", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DvPairs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVPairs", len)?; + if true { + struct_ser.serialize_field("pairs", &self.pairs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DvPairs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pairs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pairs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "pairs" => Ok(GeneratedField::Pairs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DvPairs; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVPairs") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pairs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pairs => { + if pairs__.is_some() { + return Err(serde::de::Error::duplicate_field("pairs")); + } + pairs__ = Some(map_.next_value()?); + } + } + } + Ok(DvPairs { + pairs: pairs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.DVPairs", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DvvTriplet { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVVTriplet", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; + } + if true { + struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DvvTriplet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_src_address", + "validatorSrcAddress", + "validator_dst_address", + "validatorDstAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorSrcAddress, + ValidatorDstAddress, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorSrcAddress" | "validator_src_address" => Ok(GeneratedField::ValidatorSrcAddress), + "validatorDstAddress" | "validator_dst_address" => Ok(GeneratedField::ValidatorDstAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DvvTriplet; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVVTriplet") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_src_address__ = None; + let mut validator_dst_address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorSrcAddress => { + if validator_src_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSrcAddress")); + } + validator_src_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorDstAddress => { + if validator_dst_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorDstAddress")); + } + validator_dst_address__ = Some(map_.next_value()?); + } + } + } + Ok(DvvTriplet { + delegator_address: delegator_address__.unwrap_or_default(), + validator_src_address: validator_src_address__.unwrap_or_default(), + validator_dst_address: validator_dst_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.DVVTriplet", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DvvTriplets { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVVTriplets", len)?; + if true { + struct_ser.serialize_field("triplets", &self.triplets)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DvvTriplets { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "triplets", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Triplets, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "triplets" => Ok(GeneratedField::Triplets), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DvvTriplets; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVVTriplets") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut triplets__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Triplets => { + if triplets__.is_some() { + return Err(serde::de::Error::duplicate_field("triplets")); + } + triplets__ = Some(map_.next_value()?); + } + } + } + Ok(DvvTriplets { + triplets: triplets__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.DVVTriplets", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Delegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Delegation", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + struct_ser.serialize_field("shares", &self.shares)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Delegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "shares", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + Shares, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "shares" => Ok(GeneratedField::Shares), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Delegation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Delegation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_address__ = None; + let mut shares__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Shares => { + if shares__.is_some() { + return Err(serde::de::Error::duplicate_field("shares")); + } + shares__ = Some(map_.next_value()?); + } + } + } + Ok(Delegation { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + shares: shares__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Delegation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DelegationResponse", len)?; + if let Some(v) = self.delegation.as_ref() { + struct_ser.serialize_field("delegation", v)?; + } + if let Some(v) = self.balance.as_ref() { + struct_ser.serialize_field("balance", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegation", + "balance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Delegation, + Balance, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegation" => Ok(GeneratedField::Delegation), + "balance" => Ok(GeneratedField::Balance), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DelegationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DelegationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegation__ = None; + let mut balance__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Delegation => { + if delegation__.is_some() { + return Err(serde::de::Error::duplicate_field("delegation")); + } + delegation__ = map_.next_value()?; + } + GeneratedField::Balance => { + if balance__.is_some() { + return Err(serde::de::Error::duplicate_field("balance")); + } + balance__ = map_.next_value()?; + } + } + } + Ok(DelegationResponse { + delegation: delegation__, + balance: balance__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.DelegationResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Description { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Description", len)?; + if true { + struct_ser.serialize_field("moniker", &self.moniker)?; + } + if true { + struct_ser.serialize_field("identity", &self.identity)?; + } + if true { + struct_ser.serialize_field("website", &self.website)?; + } + if true { + struct_ser.serialize_field("securityContact", &self.security_contact)?; + } + if true { + struct_ser.serialize_field("details", &self.details)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Description { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "moniker", + "identity", + "website", + "security_contact", + "securityContact", + "details", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Moniker, + Identity, + Website, + SecurityContact, + Details, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "moniker" => Ok(GeneratedField::Moniker), + "identity" => Ok(GeneratedField::Identity), + "website" => Ok(GeneratedField::Website), + "securityContact" | "security_contact" => Ok(GeneratedField::SecurityContact), + "details" => Ok(GeneratedField::Details), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Description; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Description") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut moniker__ = None; + let mut identity__ = None; + let mut website__ = None; + let mut security_contact__ = None; + let mut details__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Moniker => { + if moniker__.is_some() { + return Err(serde::de::Error::duplicate_field("moniker")); + } + moniker__ = Some(map_.next_value()?); + } + GeneratedField::Identity => { + if identity__.is_some() { + return Err(serde::de::Error::duplicate_field("identity")); + } + identity__ = Some(map_.next_value()?); + } + GeneratedField::Website => { + if website__.is_some() { + return Err(serde::de::Error::duplicate_field("website")); + } + website__ = Some(map_.next_value()?); + } + GeneratedField::SecurityContact => { + if security_contact__.is_some() { + return Err(serde::de::Error::duplicate_field("securityContact")); + } + security_contact__ = Some(map_.next_value()?); + } + GeneratedField::Details => { + if details__.is_some() { + return Err(serde::de::Error::duplicate_field("details")); + } + details__ = Some(map_.next_value()?); + } + } + } + Ok(Description { + moniker: moniker__.unwrap_or_default(), + identity: identity__.unwrap_or_default(), + website: website__.unwrap_or_default(), + security_contact: security_contact__.unwrap_or_default(), + details: details__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Description", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("lastTotalPower", pbjson::private::base64::encode(&self.last_total_power).as_str())?; + } + if true { + struct_ser.serialize_field("lastValidatorPowers", &self.last_validator_powers)?; + } + if true { + struct_ser.serialize_field("validators", &self.validators)?; + } + if true { + struct_ser.serialize_field("delegations", &self.delegations)?; + } + if true { + struct_ser.serialize_field("unbondingDelegations", &self.unbonding_delegations)?; + } + if true { + struct_ser.serialize_field("redelegations", &self.redelegations)?; + } + if true { + struct_ser.serialize_field("exported", &self.exported)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params", + "last_total_power", + "lastTotalPower", + "last_validator_powers", + "lastValidatorPowers", + "validators", + "delegations", + "unbonding_delegations", + "unbondingDelegations", + "redelegations", + "exported", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + LastTotalPower, + LastValidatorPowers, + Validators, + Delegations, + UnbondingDelegations, + Redelegations, + Exported, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + "lastTotalPower" | "last_total_power" => Ok(GeneratedField::LastTotalPower), + "lastValidatorPowers" | "last_validator_powers" => Ok(GeneratedField::LastValidatorPowers), + "validators" => Ok(GeneratedField::Validators), + "delegations" => Ok(GeneratedField::Delegations), + "unbondingDelegations" | "unbonding_delegations" => Ok(GeneratedField::UnbondingDelegations), + "redelegations" => Ok(GeneratedField::Redelegations), + "exported" => Ok(GeneratedField::Exported), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut last_total_power__ = None; + let mut last_validator_powers__ = None; + let mut validators__ = None; + let mut delegations__ = None; + let mut unbonding_delegations__ = None; + let mut redelegations__ = None; + let mut exported__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + GeneratedField::LastTotalPower => { + if last_total_power__.is_some() { + return Err(serde::de::Error::duplicate_field("lastTotalPower")); + } + last_total_power__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::LastValidatorPowers => { + if last_validator_powers__.is_some() { + return Err(serde::de::Error::duplicate_field("lastValidatorPowers")); + } + last_validator_powers__ = Some(map_.next_value()?); + } + GeneratedField::Validators => { + if validators__.is_some() { + return Err(serde::de::Error::duplicate_field("validators")); + } + validators__ = Some(map_.next_value()?); + } + GeneratedField::Delegations => { + if delegations__.is_some() { + return Err(serde::de::Error::duplicate_field("delegations")); + } + delegations__ = Some(map_.next_value()?); + } + GeneratedField::UnbondingDelegations => { + if unbonding_delegations__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingDelegations")); + } + unbonding_delegations__ = Some(map_.next_value()?); + } + GeneratedField::Redelegations => { + if redelegations__.is_some() { + return Err(serde::de::Error::duplicate_field("redelegations")); + } + redelegations__ = Some(map_.next_value()?); + } + GeneratedField::Exported => { + if exported__.is_some() { + return Err(serde::de::Error::duplicate_field("exported")); + } + exported__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + last_total_power: last_total_power__.unwrap_or_default(), + last_validator_powers: last_validator_powers__.unwrap_or_default(), + validators: validators__.unwrap_or_default(), + delegations: delegations__.unwrap_or_default(), + unbonding_delegations: unbonding_delegations__.unwrap_or_default(), + redelegations: redelegations__.unwrap_or_default(), + exported: exported__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for HistoricalInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.HistoricalInfo", len)?; + if let Some(v) = self.header.as_ref() { + struct_ser.serialize_field("header", v)?; + } + if true { + struct_ser.serialize_field("valset", &self.valset)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for HistoricalInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "header", + "valset", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Header, + Valset, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "header" => Ok(GeneratedField::Header), + "valset" => Ok(GeneratedField::Valset), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = HistoricalInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.HistoricalInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut header__ = None; + let mut valset__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Header => { + if header__.is_some() { + return Err(serde::de::Error::duplicate_field("header")); + } + header__ = map_.next_value()?; + } + GeneratedField::Valset => { + if valset__.is_some() { + return Err(serde::de::Error::duplicate_field("valset")); + } + valset__ = Some(map_.next_value()?); + } + } + } + Ok(HistoricalInfo { + header: header__, + valset: valset__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.HistoricalInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Infraction { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "INFRACTION_UNSPECIFIED", + Self::DoubleSign => "INFRACTION_DOUBLE_SIGN", + Self::Downtime => "INFRACTION_DOWNTIME", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for Infraction { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "INFRACTION_UNSPECIFIED", + "INFRACTION_DOUBLE_SIGN", + "INFRACTION_DOWNTIME", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Infraction; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "INFRACTION_UNSPECIFIED" => Ok(Infraction::Unspecified), + "INFRACTION_DOUBLE_SIGN" => Ok(Infraction::DoubleSign), + "INFRACTION_DOWNTIME" => Ok(Infraction::Downtime), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for LastValidatorPower { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.LastValidatorPower", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("power", ::alloc::string::ToString::to_string(&self.power).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for LastValidatorPower { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "power", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Power, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + "power" => Ok(GeneratedField::Power), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = LastValidatorPower; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.LastValidatorPower") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut power__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + GeneratedField::Power => { + if power__.is_some() { + return Err(serde::de::Error::duplicate_field("power")); + } + power__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(LastValidatorPower { + address: address__.unwrap_or_default(), + power: power__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.LastValidatorPower", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgBeginRedelegate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegate", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; + } + if true { + struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgBeginRedelegate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_src_address", + "validatorSrcAddress", + "validator_dst_address", + "validatorDstAddress", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorSrcAddress, + ValidatorDstAddress, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorSrcAddress" | "validator_src_address" => Ok(GeneratedField::ValidatorSrcAddress), + "validatorDstAddress" | "validator_dst_address" => Ok(GeneratedField::ValidatorDstAddress), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgBeginRedelegate; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgBeginRedelegate") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_src_address__ = None; + let mut validator_dst_address__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorSrcAddress => { + if validator_src_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSrcAddress")); + } + validator_src_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorDstAddress => { + if validator_dst_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorDstAddress")); + } + validator_dst_address__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + } + } + Ok(MsgBeginRedelegate { + delegator_address: delegator_address__.unwrap_or_default(), + validator_src_address: validator_src_address__.unwrap_or_default(), + validator_dst_address: validator_dst_address__.unwrap_or_default(), + amount: amount__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgBeginRedelegateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegateResponse", len)?; + if let Some(v) = self.completion_time.as_ref() { + struct_ser.serialize_field("completionTime", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgBeginRedelegateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "completion_time", + "completionTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CompletionTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgBeginRedelegateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgBeginRedelegateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut completion_time__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CompletionTime => { + if completion_time__.is_some() { + return Err(serde::de::Error::duplicate_field("completionTime")); + } + completion_time__ = map_.next_value()?; + } + } + } + Ok(MsgBeginRedelegateResponse { + completion_time: completion_time__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCancelUnbondingDelegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("creationHeight", ::alloc::string::ToString::to_string(&self.creation_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCancelUnbondingDelegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "amount", + "creation_height", + "creationHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + Amount, + CreationHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "amount" => Ok(GeneratedField::Amount), + "creationHeight" | "creation_height" => Ok(GeneratedField::CreationHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelUnbondingDelegation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCancelUnbondingDelegation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_address__ = None; + let mut amount__ = None; + let mut creation_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + GeneratedField::CreationHeight => { + if creation_height__.is_some() { + return Err(serde::de::Error::duplicate_field("creationHeight")); + } + creation_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgCancelUnbondingDelegation { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + amount: amount__, + creation_height: creation_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCancelUnbondingDelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCancelUnbondingDelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelUnbondingDelegationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgCancelUnbondingDelegationResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateValidator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCreateValidator", len)?; + if let Some(v) = self.description.as_ref() { + struct_ser.serialize_field("description", v)?; + } + if let Some(v) = self.commission.as_ref() { + struct_ser.serialize_field("commission", v)?; + } + if true { + struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; + } + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.pubkey.as_ref() { + struct_ser.serialize_field("pubkey", v)?; + } + if let Some(v) = self.value.as_ref() { + struct_ser.serialize_field("value", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateValidator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "description", + "commission", + "min_self_delegation", + "minSelfDelegation", + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "pubkey", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Description, + Commission, + MinSelfDelegation, + DelegatorAddress, + ValidatorAddress, + Pubkey, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "description" => Ok(GeneratedField::Description), + "commission" => Ok(GeneratedField::Commission), + "minSelfDelegation" | "min_self_delegation" => Ok(GeneratedField::MinSelfDelegation), + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "pubkey" => Ok(GeneratedField::Pubkey), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateValidator; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCreateValidator") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut description__ = None; + let mut commission__ = None; + let mut min_self_delegation__ = None; + let mut delegator_address__ = None; + let mut validator_address__ = None; + let mut pubkey__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = map_.next_value()?; + } + GeneratedField::Commission => { + if commission__.is_some() { + return Err(serde::de::Error::duplicate_field("commission")); + } + commission__ = map_.next_value()?; + } + GeneratedField::MinSelfDelegation => { + if min_self_delegation__.is_some() { + return Err(serde::de::Error::duplicate_field("minSelfDelegation")); + } + min_self_delegation__ = Some(map_.next_value()?); + } + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Pubkey => { + if pubkey__.is_some() { + return Err(serde::de::Error::duplicate_field("pubkey")); + } + pubkey__ = map_.next_value()?; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = map_.next_value()?; + } + } + } + Ok(MsgCreateValidator { + description: description__, + commission: commission__, + min_self_delegation: min_self_delegation__.unwrap_or_default(), + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + pubkey: pubkey__, + value: value__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCreateValidator", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgCreateValidatorResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateValidatorResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCreateValidatorResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgCreateValidatorResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgCreateValidatorResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgDelegate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgDelegate", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgDelegate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDelegate; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgDelegate") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_address__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + } + } + Ok(MsgDelegate { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + amount: amount__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgDelegate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgDelegateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgDelegateResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgDelegateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDelegateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgDelegateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgDelegateResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgDelegateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgEditValidator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgEditValidator", len)?; + if let Some(v) = self.description.as_ref() { + struct_ser.serialize_field("description", v)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + struct_ser.serialize_field("commissionRate", &self.commission_rate)?; + } + if true { + struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgEditValidator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "description", + "validator_address", + "validatorAddress", + "commission_rate", + "commissionRate", + "min_self_delegation", + "minSelfDelegation", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Description, + ValidatorAddress, + CommissionRate, + MinSelfDelegation, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "description" => Ok(GeneratedField::Description), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "commissionRate" | "commission_rate" => Ok(GeneratedField::CommissionRate), + "minSelfDelegation" | "min_self_delegation" => Ok(GeneratedField::MinSelfDelegation), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgEditValidator; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgEditValidator") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut description__ = None; + let mut validator_address__ = None; + let mut commission_rate__ = None; + let mut min_self_delegation__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = map_.next_value()?; + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::CommissionRate => { + if commission_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("commissionRate")); + } + commission_rate__ = Some(map_.next_value()?); + } + GeneratedField::MinSelfDelegation => { + if min_self_delegation__.is_some() { + return Err(serde::de::Error::duplicate_field("minSelfDelegation")); + } + min_self_delegation__ = Some(map_.next_value()?); + } + } + } + Ok(MsgEditValidator { + description: description__, + validator_address: validator_address__.unwrap_or_default(), + commission_rate: commission_rate__.unwrap_or_default(), + min_self_delegation: min_self_delegation__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgEditValidator", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgEditValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgEditValidatorResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgEditValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgEditValidatorResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgEditValidatorResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgEditValidatorResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgEditValidatorResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUndelegate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegate", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUndelegate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + Amount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUndelegate; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgUndelegate") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_address__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + } + } + Ok(MsgUndelegate { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + amount: amount__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUndelegate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUndelegateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegateResponse", len)?; + if let Some(v) = self.completion_time.as_ref() { + struct_ser.serialize_field("completionTime", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "completion_time", + "completionTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CompletionTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUndelegateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgUndelegateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut completion_time__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CompletionTime => { + if completion_time__.is_some() { + return Err(serde::de::Error::duplicate_field("completionTime")); + } + completion_time__ = map_.next_value()?; + } + } + } + Ok(MsgUndelegateResponse { + completion_time: completion_time__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUndelegateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUpdateParams", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authority", + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUpdateParams", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgUpdateParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Params", len)?; + if let Some(v) = self.unbonding_time.as_ref() { + struct_ser.serialize_field("unbondingTime", v)?; + } + if true { + struct_ser.serialize_field("maxValidators", &self.max_validators)?; + } + if true { + struct_ser.serialize_field("maxEntries", &self.max_entries)?; + } + if true { + struct_ser.serialize_field("historicalEntries", &self.historical_entries)?; + } + if true { + struct_ser.serialize_field("bondDenom", &self.bond_denom)?; + } + if true { + struct_ser.serialize_field("minCommissionRate", &self.min_commission_rate)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "unbonding_time", + "unbondingTime", + "max_validators", + "maxValidators", + "max_entries", + "maxEntries", + "historical_entries", + "historicalEntries", + "bond_denom", + "bondDenom", + "min_commission_rate", + "minCommissionRate", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UnbondingTime, + MaxValidators, + MaxEntries, + HistoricalEntries, + BondDenom, + MinCommissionRate, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "unbondingTime" | "unbonding_time" => Ok(GeneratedField::UnbondingTime), + "maxValidators" | "max_validators" => Ok(GeneratedField::MaxValidators), + "maxEntries" | "max_entries" => Ok(GeneratedField::MaxEntries), + "historicalEntries" | "historical_entries" => Ok(GeneratedField::HistoricalEntries), + "bondDenom" | "bond_denom" => Ok(GeneratedField::BondDenom), + "minCommissionRate" | "min_commission_rate" => Ok(GeneratedField::MinCommissionRate), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Params; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut unbonding_time__ = None; + let mut max_validators__ = None; + let mut max_entries__ = None; + let mut historical_entries__ = None; + let mut bond_denom__ = None; + let mut min_commission_rate__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UnbondingTime => { + if unbonding_time__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingTime")); + } + unbonding_time__ = map_.next_value()?; + } + GeneratedField::MaxValidators => { + if max_validators__.is_some() { + return Err(serde::de::Error::duplicate_field("maxValidators")); + } + max_validators__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::MaxEntries => { + if max_entries__.is_some() { + return Err(serde::de::Error::duplicate_field("maxEntries")); + } + max_entries__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::HistoricalEntries => { + if historical_entries__.is_some() { + return Err(serde::de::Error::duplicate_field("historicalEntries")); + } + historical_entries__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::BondDenom => { + if bond_denom__.is_some() { + return Err(serde::de::Error::duplicate_field("bondDenom")); + } + bond_denom__ = Some(map_.next_value()?); + } + GeneratedField::MinCommissionRate => { + if min_commission_rate__.is_some() { + return Err(serde::de::Error::duplicate_field("minCommissionRate")); + } + min_commission_rate__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + unbonding_time: unbonding_time__, + max_validators: max_validators__.unwrap_or_default(), + max_entries: max_entries__.unwrap_or_default(), + historical_entries: historical_entries__.unwrap_or_default(), + bond_denom: bond_denom__.unwrap_or_default(), + min_commission_rate: min_commission_rate__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Pool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Pool", len)?; + if true { + struct_ser.serialize_field("notBondedTokens", &self.not_bonded_tokens)?; + } + if true { + struct_ser.serialize_field("bondedTokens", &self.bonded_tokens)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Pool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "not_bonded_tokens", + "notBondedTokens", + "bonded_tokens", + "bondedTokens", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NotBondedTokens, + BondedTokens, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "notBondedTokens" | "not_bonded_tokens" => Ok(GeneratedField::NotBondedTokens), + "bondedTokens" | "bonded_tokens" => Ok(GeneratedField::BondedTokens), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Pool; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Pool") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut not_bonded_tokens__ = None; + let mut bonded_tokens__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NotBondedTokens => { + if not_bonded_tokens__.is_some() { + return Err(serde::de::Error::duplicate_field("notBondedTokens")); + } + not_bonded_tokens__ = Some(map_.next_value()?); + } + GeneratedField::BondedTokens => { + if bonded_tokens__.is_some() { + return Err(serde::de::Error::duplicate_field("bondedTokens")); + } + bonded_tokens__ = Some(map_.next_value()?); + } + } + } + Ok(Pool { + not_bonded_tokens: not_bonded_tokens__.unwrap_or_default(), + bonded_tokens: bonded_tokens__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Pool", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegationRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegationRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegationRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "validator_addr", + "validatorAddr", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + ValidatorAddr, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegationRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegationRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut validator_addr__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddr => { + if validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddr")); + } + validator_addr__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDelegationRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + validator_addr: validator_addr__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegationRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegationResponse", len)?; + if let Some(v) = self.delegation_response.as_ref() { + struct_ser.serialize_field("delegationResponse", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegation_response", + "delegationResponse", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegationResponse, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegationResponse" | "delegation_response" => Ok(GeneratedField::DelegationResponse), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegation_response__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegationResponse => { + if delegation_response__.is_some() { + return Err(serde::de::Error::duplicate_field("delegationResponse")); + } + delegation_response__ = map_.next_value()?; + } + } + } + Ok(QueryDelegationResponse { + delegation_response: delegation_response__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegationResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorDelegationsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorDelegationsRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", len)?; + if true { + struct_ser.serialize_field("delegationResponses", &self.delegation_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegation_responses", + "delegationResponses", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegationResponses, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegationResponses" | "delegation_responses" => Ok(GeneratedField::DelegationResponses), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorDelegationsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegation_responses__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegationResponses => { + if delegation_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("delegationResponses")); + } + delegation_responses__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorDelegationsResponse { + delegation_responses: delegation_responses__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorUnbondingDelegationsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorUnbondingDelegationsRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", len)?; + if true { + struct_ser.serialize_field("unbondingResponses", &self.unbonding_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "unbonding_responses", + "unbondingResponses", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UnbondingResponses, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "unbondingResponses" | "unbonding_responses" => Ok(GeneratedField::UnbondingResponses), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorUnbondingDelegationsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut unbonding_responses__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UnbondingResponses => { + if unbonding_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingResponses")); + } + unbonding_responses__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorUnbondingDelegationsResponse { + unbonding_responses: unbonding_responses__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorValidatorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "validator_addr", + "validatorAddr", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + ValidatorAddr, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorValidatorRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut validator_addr__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddr => { + if validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddr")); + } + validator_addr__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDelegatorValidatorRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + validator_addr: validator_addr__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", len)?; + if let Some(v) = self.validator.as_ref() { + struct_ser.serialize_field("validator", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validator, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validator" => Ok(GeneratedField::Validator), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorValidatorResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Validator => { + if validator__.is_some() { + return Err(serde::de::Error::duplicate_field("validator")); + } + validator__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorValidatorResponse { + validator: validator__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorValidatorsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorValidatorsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorValidatorsRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDelegatorValidatorsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", len)?; + if true { + struct_ser.serialize_field("validators", &self.validators)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validators", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validators, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validators" => Ok(GeneratedField::Validators), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDelegatorValidatorsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validators__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Validators => { + if validators__.is_some() { + return Err(serde::de::Error::duplicate_field("validators")); + } + validators__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDelegatorValidatorsResponse { + validators: validators__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryHistoricalInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryHistoricalInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryHistoricalInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryHistoricalInfoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryHistoricalInfoRequest { + height: height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryHistoricalInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoResponse", len)?; + if let Some(v) = self.hist.as_ref() { + struct_ser.serialize_field("hist", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryHistoricalInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "hist", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Hist, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "hist" => Ok(GeneratedField::Hist), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryHistoricalInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryHistoricalInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut hist__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Hist => { + if hist__.is_some() { + return Err(serde::de::Error::duplicate_field("hist")); + } + hist__ = map_.next_value()?; + } + } + } + Ok(QueryHistoricalInfoResponse { + hist: hist__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryParamsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(QueryParamsResponse { + params: params__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPoolRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryPoolRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPoolRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPoolRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryPoolRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryPoolRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryPoolRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryPoolResponse", len)?; + if let Some(v) = self.pool.as_ref() { + struct_ser.serialize_field("pool", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pool", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pool, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "pool" => Ok(GeneratedField::Pool), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPoolResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryPoolResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pool__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pool => { + if pool__.is_some() { + return Err(serde::de::Error::duplicate_field("pool")); + } + pool__ = map_.next_value()?; + } + } + } + Ok(QueryPoolResponse { + pool: pool__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryPoolResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryRedelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryRedelegationsRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if true { + struct_ser.serialize_field("srcValidatorAddr", &self.src_validator_addr)?; + } + if true { + struct_ser.serialize_field("dstValidatorAddr", &self.dst_validator_addr)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryRedelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "src_validator_addr", + "srcValidatorAddr", + "dst_validator_addr", + "dstValidatorAddr", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + SrcValidatorAddr, + DstValidatorAddr, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "srcValidatorAddr" | "src_validator_addr" => Ok(GeneratedField::SrcValidatorAddr), + "dstValidatorAddr" | "dst_validator_addr" => Ok(GeneratedField::DstValidatorAddr), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryRedelegationsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryRedelegationsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut src_validator_addr__ = None; + let mut dst_validator_addr__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::SrcValidatorAddr => { + if src_validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("srcValidatorAddr")); + } + src_validator_addr__ = Some(map_.next_value()?); + } + GeneratedField::DstValidatorAddr => { + if dst_validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("dstValidatorAddr")); + } + dst_validator_addr__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryRedelegationsRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + src_validator_addr: src_validator_addr__.unwrap_or_default(), + dst_validator_addr: dst_validator_addr__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryRedelegationsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryRedelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryRedelegationsResponse", len)?; + if true { + struct_ser.serialize_field("redelegationResponses", &self.redelegation_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryRedelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "redelegation_responses", + "redelegationResponses", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RedelegationResponses, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "redelegationResponses" | "redelegation_responses" => Ok(GeneratedField::RedelegationResponses), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryRedelegationsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryRedelegationsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut redelegation_responses__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RedelegationResponses => { + if redelegation_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("redelegationResponses")); + } + redelegation_responses__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryRedelegationsResponse { + redelegation_responses: redelegation_responses__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryRedelegationsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUnbondingDelegationRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", len)?; + if true { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUnbondingDelegationRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_addr", + "delegatorAddr", + "validator_addr", + "validatorAddr", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + ValidatorAddr, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddr" | "delegator_addr" => Ok(GeneratedField::DelegatorAddr), + "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnbondingDelegationRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryUnbondingDelegationRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_addr__ = None; + let mut validator_addr__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddr => { + if delegator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddr")); + } + delegator_addr__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddr => { + if validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddr")); + } + validator_addr__ = Some(map_.next_value()?); + } + } + } + Ok(QueryUnbondingDelegationRequest { + delegator_addr: delegator_addr__.unwrap_or_default(), + validator_addr: validator_addr__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUnbondingDelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", len)?; + if let Some(v) = self.unbond.as_ref() { + struct_ser.serialize_field("unbond", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUnbondingDelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "unbond", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Unbond, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "unbond" => Ok(GeneratedField::Unbond), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnbondingDelegationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryUnbondingDelegationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut unbond__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Unbond => { + if unbond__.is_some() { + return Err(serde::de::Error::duplicate_field("unbond")); + } + unbond__ = map_.next_value()?; + } + } + } + Ok(QueryUnbondingDelegationResponse { + unbond: unbond__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryUnbondingDelegationResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_addr", + "validatorAddr", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorDelegationsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorDelegationsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_addr__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddr => { + if validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddr")); + } + validator_addr__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorDelegationsRequest { + validator_addr: validator_addr__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", len)?; + if true { + struct_ser.serialize_field("delegationResponses", &self.delegation_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegation_responses", + "delegationResponses", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegationResponses, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegationResponses" | "delegation_responses" => Ok(GeneratedField::DelegationResponses), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorDelegationsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorDelegationsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegation_responses__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegationResponses => { + if delegation_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("delegationResponses")); + } + delegation_responses__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorDelegationsResponse { + delegation_responses: delegation_responses__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_addr", + "validatorAddr", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_addr__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddr => { + if validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddr")); + } + validator_addr__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidatorRequest { + validator_addr: validator_addr__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorResponse", len)?; + if let Some(v) = self.validator.as_ref() { + struct_ser.serialize_field("validator", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validator, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validator" => Ok(GeneratedField::Validator), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Validator => { + if validator__.is_some() { + return Err(serde::de::Error::duplicate_field("validator")); + } + validator__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorResponse { + validator: validator__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", len)?; + if true { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validator_addr", + "validatorAddr", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validatorAddr" | "validator_addr" => Ok(GeneratedField::ValidatorAddr), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorUnbondingDelegationsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validator_addr__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ValidatorAddr => { + if validator_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddr")); + } + validator_addr__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorUnbondingDelegationsRequest { + validator_addr: validator_addr__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", len)?; + if true { + struct_ser.serialize_field("unbondingResponses", &self.unbonding_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "unbonding_responses", + "unbondingResponses", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UnbondingResponses, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "unbondingResponses" | "unbonding_responses" => Ok(GeneratedField::UnbondingResponses), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorUnbondingDelegationsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut unbonding_responses__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UnbondingResponses => { + if unbonding_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingResponses")); + } + unbonding_responses__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorUnbondingDelegationsResponse { + unbonding_responses: unbonding_responses__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorsRequest", len)?; + if true { + struct_ser.serialize_field("status", &self.status)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "status", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Status, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "status" => Ok(GeneratedField::Status), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut status__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorsRequest { + status: status__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryValidatorsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorsResponse", len)?; + if true { + struct_ser.serialize_field("validators", &self.validators)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryValidatorsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "validators", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validators, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "validators" => Ok(GeneratedField::Validators), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidatorsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut validators__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Validators => { + if validators__.is_some() { + return Err(serde::de::Error::duplicate_field("validators")); + } + validators__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryValidatorsResponse { + validators: validators__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.QueryValidatorsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Redelegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Redelegation", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; + } + if true { + struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; + } + if true { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Redelegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_src_address", + "validatorSrcAddress", + "validator_dst_address", + "validatorDstAddress", + "entries", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorSrcAddress, + ValidatorDstAddress, + Entries, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorSrcAddress" | "validator_src_address" => Ok(GeneratedField::ValidatorSrcAddress), + "validatorDstAddress" | "validator_dst_address" => Ok(GeneratedField::ValidatorDstAddress), + "entries" => Ok(GeneratedField::Entries), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Redelegation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Redelegation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_src_address__ = None; + let mut validator_dst_address__ = None; + let mut entries__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorSrcAddress => { + if validator_src_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorSrcAddress")); + } + validator_src_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorDstAddress => { + if validator_dst_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorDstAddress")); + } + validator_dst_address__ = Some(map_.next_value()?); + } + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); + } + entries__ = Some(map_.next_value()?); + } + } + } + Ok(Redelegation { + delegator_address: delegator_address__.unwrap_or_default(), + validator_src_address: validator_src_address__.unwrap_or_default(), + validator_dst_address: validator_dst_address__.unwrap_or_default(), + entries: entries__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Redelegation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RedelegationEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationEntry", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("creationHeight", ::alloc::string::ToString::to_string(&self.creation_height).as_str())?; + } + if let Some(v) = self.completion_time.as_ref() { + struct_ser.serialize_field("completionTime", v)?; + } + if true { + struct_ser.serialize_field("initialBalance", &self.initial_balance)?; + } + if true { + struct_ser.serialize_field("sharesDst", &self.shares_dst)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unbondingId", ::alloc::string::ToString::to_string(&self.unbonding_id).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unbondingOnHoldRefCount", ::alloc::string::ToString::to_string(&self.unbonding_on_hold_ref_count).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RedelegationEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "creation_height", + "creationHeight", + "completion_time", + "completionTime", + "initial_balance", + "initialBalance", + "shares_dst", + "sharesDst", + "unbonding_id", + "unbondingId", + "unbonding_on_hold_ref_count", + "unbondingOnHoldRefCount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CreationHeight, + CompletionTime, + InitialBalance, + SharesDst, + UnbondingId, + UnbondingOnHoldRefCount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "creationHeight" | "creation_height" => Ok(GeneratedField::CreationHeight), + "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), + "initialBalance" | "initial_balance" => Ok(GeneratedField::InitialBalance), + "sharesDst" | "shares_dst" => Ok(GeneratedField::SharesDst), + "unbondingId" | "unbonding_id" => Ok(GeneratedField::UnbondingId), + "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => Ok(GeneratedField::UnbondingOnHoldRefCount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RedelegationEntry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.RedelegationEntry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut creation_height__ = None; + let mut completion_time__ = None; + let mut initial_balance__ = None; + let mut shares_dst__ = None; + let mut unbonding_id__ = None; + let mut unbonding_on_hold_ref_count__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CreationHeight => { + if creation_height__.is_some() { + return Err(serde::de::Error::duplicate_field("creationHeight")); + } + creation_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CompletionTime => { + if completion_time__.is_some() { + return Err(serde::de::Error::duplicate_field("completionTime")); + } + completion_time__ = map_.next_value()?; + } + GeneratedField::InitialBalance => { + if initial_balance__.is_some() { + return Err(serde::de::Error::duplicate_field("initialBalance")); + } + initial_balance__ = Some(map_.next_value()?); + } + GeneratedField::SharesDst => { + if shares_dst__.is_some() { + return Err(serde::de::Error::duplicate_field("sharesDst")); + } + shares_dst__ = Some(map_.next_value()?); + } + GeneratedField::UnbondingId => { + if unbonding_id__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingId")); + } + unbonding_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UnbondingOnHoldRefCount => { + if unbonding_on_hold_ref_count__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingOnHoldRefCount")); + } + unbonding_on_hold_ref_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(RedelegationEntry { + creation_height: creation_height__.unwrap_or_default(), + completion_time: completion_time__, + initial_balance: initial_balance__.unwrap_or_default(), + shares_dst: shares_dst__.unwrap_or_default(), + unbonding_id: unbonding_id__.unwrap_or_default(), + unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.RedelegationEntry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RedelegationEntryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationEntryResponse", len)?; + if let Some(v) = self.redelegation_entry.as_ref() { + struct_ser.serialize_field("redelegationEntry", v)?; + } + if true { + struct_ser.serialize_field("balance", &self.balance)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RedelegationEntryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "redelegation_entry", + "redelegationEntry", + "balance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RedelegationEntry, + Balance, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "redelegationEntry" | "redelegation_entry" => Ok(GeneratedField::RedelegationEntry), + "balance" => Ok(GeneratedField::Balance), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RedelegationEntryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.RedelegationEntryResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut redelegation_entry__ = None; + let mut balance__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::RedelegationEntry => { + if redelegation_entry__.is_some() { + return Err(serde::de::Error::duplicate_field("redelegationEntry")); + } + redelegation_entry__ = map_.next_value()?; + } + GeneratedField::Balance => { + if balance__.is_some() { + return Err(serde::de::Error::duplicate_field("balance")); + } + balance__ = Some(map_.next_value()?); + } + } + } + Ok(RedelegationEntryResponse { + redelegation_entry: redelegation_entry__, + balance: balance__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.RedelegationEntryResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for RedelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationResponse", len)?; + if let Some(v) = self.redelegation.as_ref() { + struct_ser.serialize_field("redelegation", v)?; + } + if true { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for RedelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "redelegation", + "entries", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Redelegation, + Entries, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "redelegation" => Ok(GeneratedField::Redelegation), + "entries" => Ok(GeneratedField::Entries), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = RedelegationResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.RedelegationResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut redelegation__ = None; + let mut entries__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Redelegation => { + if redelegation__.is_some() { + return Err(serde::de::Error::duplicate_field("redelegation")); + } + redelegation__ = map_.next_value()?; + } + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); + } + entries__ = Some(map_.next_value()?); + } + } + } + Ok(RedelegationResponse { + redelegation: redelegation__, + entries: entries__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.RedelegationResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StakeAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> 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.validators.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.StakeAuthorization", len)?; + if let Some(v) = self.max_tokens.as_ref() { + struct_ser.serialize_field("maxTokens", v)?; + } + if true { + let v = AuthorizationType::try_from(self.authorization_type) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.authorization_type)))?; + struct_ser.serialize_field("authorizationType", &v)?; + } + if let Some(v) = self.validators.as_ref() { + match v { + stake_authorization::Policy::AllowList(v) => { + struct_ser.serialize_field("allowList", v)?; + } + stake_authorization::Policy::DenyList(v) => { + struct_ser.serialize_field("denyList", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StakeAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "max_tokens", + "maxTokens", + "authorization_type", + "authorizationType", + "allow_list", + "allowList", + "deny_list", + "denyList", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MaxTokens, + AuthorizationType, + AllowList, + DenyList, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "maxTokens" | "max_tokens" => Ok(GeneratedField::MaxTokens), + "authorizationType" | "authorization_type" => Ok(GeneratedField::AuthorizationType), + "allowList" | "allow_list" => Ok(GeneratedField::AllowList), + "denyList" | "deny_list" => Ok(GeneratedField::DenyList), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StakeAuthorization; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.StakeAuthorization") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut max_tokens__ = None; + let mut authorization_type__ = None; + let mut validators__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MaxTokens => { + if max_tokens__.is_some() { + return Err(serde::de::Error::duplicate_field("maxTokens")); + } + max_tokens__ = map_.next_value()?; + } + GeneratedField::AuthorizationType => { + if authorization_type__.is_some() { + return Err(serde::de::Error::duplicate_field("authorizationType")); + } + authorization_type__ = Some(map_.next_value::()? as i32); + } + GeneratedField::AllowList => { + if validators__.is_some() { + return Err(serde::de::Error::duplicate_field("allowList")); + } + validators__ = map_.next_value::<::core::option::Option<_>>()?.map(stake_authorization::Policy::AllowList) +; + } + GeneratedField::DenyList => { + if validators__.is_some() { + return Err(serde::de::Error::duplicate_field("denyList")); + } + validators__ = map_.next_value::<::core::option::Option<_>>()?.map(stake_authorization::Policy::DenyList) +; + } + } + } + Ok(StakeAuthorization { + max_tokens: max_tokens__, + authorization_type: authorization_type__.unwrap_or_default(), + validators: validators__, + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.StakeAuthorization", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for stake_authorization::Validators { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.StakeAuthorization.Validators", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for stake_authorization::Validators { + #[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 = stake_authorization::Validators; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.StakeAuthorization.Validators") + } + + 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(stake_authorization::Validators { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.StakeAuthorization.Validators", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UnbondingDelegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegation", len)?; + if true { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if true { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if true { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UnbondingDelegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "delegator_address", + "delegatorAddress", + "validator_address", + "validatorAddress", + "entries", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + ValidatorAddress, + Entries, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "delegatorAddress" | "delegator_address" => Ok(GeneratedField::DelegatorAddress), + "validatorAddress" | "validator_address" => Ok(GeneratedField::ValidatorAddress), + "entries" => Ok(GeneratedField::Entries), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UnbondingDelegation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.UnbondingDelegation") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut delegator_address__ = None; + let mut validator_address__ = None; + let mut entries__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DelegatorAddress => { + if delegator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorAddress")); + } + delegator_address__ = Some(map_.next_value()?); + } + GeneratedField::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Entries => { + if entries__.is_some() { + return Err(serde::de::Error::duplicate_field("entries")); + } + entries__ = Some(map_.next_value()?); + } + } + } + Ok(UnbondingDelegation { + delegator_address: delegator_address__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + entries: entries__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.UnbondingDelegation", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UnbondingDelegationEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegationEntry", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("creationHeight", ::alloc::string::ToString::to_string(&self.creation_height).as_str())?; + } + if let Some(v) = self.completion_time.as_ref() { + struct_ser.serialize_field("completionTime", v)?; + } + if true { + struct_ser.serialize_field("initialBalance", &self.initial_balance)?; + } + if true { + struct_ser.serialize_field("balance", &self.balance)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unbondingId", ::alloc::string::ToString::to_string(&self.unbonding_id).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unbondingOnHoldRefCount", ::alloc::string::ToString::to_string(&self.unbonding_on_hold_ref_count).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UnbondingDelegationEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "creation_height", + "creationHeight", + "completion_time", + "completionTime", + "initial_balance", + "initialBalance", + "balance", + "unbonding_id", + "unbondingId", + "unbonding_on_hold_ref_count", + "unbondingOnHoldRefCount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CreationHeight, + CompletionTime, + InitialBalance, + Balance, + UnbondingId, + UnbondingOnHoldRefCount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "creationHeight" | "creation_height" => Ok(GeneratedField::CreationHeight), + "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), + "initialBalance" | "initial_balance" => Ok(GeneratedField::InitialBalance), + "balance" => Ok(GeneratedField::Balance), + "unbondingId" | "unbonding_id" => Ok(GeneratedField::UnbondingId), + "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => Ok(GeneratedField::UnbondingOnHoldRefCount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UnbondingDelegationEntry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.UnbondingDelegationEntry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut creation_height__ = None; + let mut completion_time__ = None; + let mut initial_balance__ = None; + let mut balance__ = None; + let mut unbonding_id__ = None; + let mut unbonding_on_hold_ref_count__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CreationHeight => { + if creation_height__.is_some() { + return Err(serde::de::Error::duplicate_field("creationHeight")); + } + creation_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CompletionTime => { + if completion_time__.is_some() { + return Err(serde::de::Error::duplicate_field("completionTime")); + } + completion_time__ = map_.next_value()?; + } + GeneratedField::InitialBalance => { + if initial_balance__.is_some() { + return Err(serde::de::Error::duplicate_field("initialBalance")); + } + initial_balance__ = Some(map_.next_value()?); + } + GeneratedField::Balance => { + if balance__.is_some() { + return Err(serde::de::Error::duplicate_field("balance")); + } + balance__ = Some(map_.next_value()?); + } + GeneratedField::UnbondingId => { + if unbonding_id__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingId")); + } + unbonding_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UnbondingOnHoldRefCount => { + if unbonding_on_hold_ref_count__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingOnHoldRefCount")); + } + unbonding_on_hold_ref_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(UnbondingDelegationEntry { + creation_height: creation_height__.unwrap_or_default(), + completion_time: completion_time__, + initial_balance: initial_balance__.unwrap_or_default(), + balance: balance__.unwrap_or_default(), + unbonding_id: unbonding_id__.unwrap_or_default(), + unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.UnbondingDelegationEntry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValAddresses { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.ValAddresses", len)?; + if true { + struct_ser.serialize_field("addresses", &self.addresses)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValAddresses { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "addresses", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Addresses, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "addresses" => Ok(GeneratedField::Addresses), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValAddresses; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.ValAddresses") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut addresses__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Addresses => { + if addresses__.is_some() { + return Err(serde::de::Error::duplicate_field("addresses")); + } + addresses__ = Some(map_.next_value()?); + } + } + } + Ok(ValAddresses { + addresses: addresses__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.ValAddresses", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Validator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Validator", len)?; + if true { + struct_ser.serialize_field("operatorAddress", &self.operator_address)?; + } + if let Some(v) = self.consensus_pubkey.as_ref() { + struct_ser.serialize_field("consensusPubkey", v)?; + } + if true { + struct_ser.serialize_field("jailed", &self.jailed)?; + } + if true { + let v = BondStatus::try_from(self.status) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.status)))?; + struct_ser.serialize_field("status", &v)?; + } + if true { + struct_ser.serialize_field("tokens", &self.tokens)?; + } + if true { + struct_ser.serialize_field("delegatorShares", &self.delegator_shares)?; + } + if let Some(v) = self.description.as_ref() { + struct_ser.serialize_field("description", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unbondingHeight", ::alloc::string::ToString::to_string(&self.unbonding_height).as_str())?; + } + if let Some(v) = self.unbonding_time.as_ref() { + struct_ser.serialize_field("unbondingTime", v)?; + } + if let Some(v) = self.commission.as_ref() { + struct_ser.serialize_field("commission", v)?; + } + if true { + struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("unbondingOnHoldRefCount", ::alloc::string::ToString::to_string(&self.unbonding_on_hold_ref_count).as_str())?; + } + if true { + struct_ser.serialize_field("unbondingIds", &self.unbonding_ids.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Validator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "operator_address", + "operatorAddress", + "consensus_pubkey", + "consensusPubkey", + "jailed", + "status", + "tokens", + "delegator_shares", + "delegatorShares", + "description", + "unbonding_height", + "unbondingHeight", + "unbonding_time", + "unbondingTime", + "commission", + "min_self_delegation", + "minSelfDelegation", + "unbonding_on_hold_ref_count", + "unbondingOnHoldRefCount", + "unbonding_ids", + "unbondingIds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + OperatorAddress, + ConsensusPubkey, + Jailed, + Status, + Tokens, + DelegatorShares, + Description, + UnbondingHeight, + UnbondingTime, + Commission, + MinSelfDelegation, + UnbondingOnHoldRefCount, + UnbondingIds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "operatorAddress" | "operator_address" => Ok(GeneratedField::OperatorAddress), + "consensusPubkey" | "consensus_pubkey" => Ok(GeneratedField::ConsensusPubkey), + "jailed" => Ok(GeneratedField::Jailed), + "status" => Ok(GeneratedField::Status), + "tokens" => Ok(GeneratedField::Tokens), + "delegatorShares" | "delegator_shares" => Ok(GeneratedField::DelegatorShares), + "description" => Ok(GeneratedField::Description), + "unbondingHeight" | "unbonding_height" => Ok(GeneratedField::UnbondingHeight), + "unbondingTime" | "unbonding_time" => Ok(GeneratedField::UnbondingTime), + "commission" => Ok(GeneratedField::Commission), + "minSelfDelegation" | "min_self_delegation" => Ok(GeneratedField::MinSelfDelegation), + "unbondingOnHoldRefCount" | "unbonding_on_hold_ref_count" => Ok(GeneratedField::UnbondingOnHoldRefCount), + "unbondingIds" | "unbonding_ids" => Ok(GeneratedField::UnbondingIds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Validator; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Validator") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut operator_address__ = None; + let mut consensus_pubkey__ = None; + let mut jailed__ = None; + let mut status__ = None; + let mut tokens__ = None; + let mut delegator_shares__ = None; + let mut description__ = None; + let mut unbonding_height__ = None; + let mut unbonding_time__ = None; + let mut commission__ = None; + let mut min_self_delegation__ = None; + let mut unbonding_on_hold_ref_count__ = None; + let mut unbonding_ids__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::OperatorAddress => { + if operator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("operatorAddress")); + } + operator_address__ = Some(map_.next_value()?); + } + GeneratedField::ConsensusPubkey => { + if consensus_pubkey__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusPubkey")); + } + consensus_pubkey__ = map_.next_value()?; + } + GeneratedField::Jailed => { + if jailed__.is_some() { + return Err(serde::de::Error::duplicate_field("jailed")); + } + jailed__ = Some(map_.next_value()?); + } + GeneratedField::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Tokens => { + if tokens__.is_some() { + return Err(serde::de::Error::duplicate_field("tokens")); + } + tokens__ = Some(map_.next_value()?); + } + GeneratedField::DelegatorShares => { + if delegator_shares__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatorShares")); + } + delegator_shares__ = Some(map_.next_value()?); + } + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = map_.next_value()?; + } + GeneratedField::UnbondingHeight => { + if unbonding_height__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingHeight")); + } + unbonding_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UnbondingTime => { + if unbonding_time__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingTime")); + } + unbonding_time__ = map_.next_value()?; + } + GeneratedField::Commission => { + if commission__.is_some() { + return Err(serde::de::Error::duplicate_field("commission")); + } + commission__ = map_.next_value()?; + } + GeneratedField::MinSelfDelegation => { + if min_self_delegation__.is_some() { + return Err(serde::de::Error::duplicate_field("minSelfDelegation")); + } + min_self_delegation__ = Some(map_.next_value()?); + } + GeneratedField::UnbondingOnHoldRefCount => { + if unbonding_on_hold_ref_count__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingOnHoldRefCount")); + } + unbonding_on_hold_ref_count__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::UnbondingIds => { + if unbonding_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("unbondingIds")); + } + unbonding_ids__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(Validator { + operator_address: operator_address__.unwrap_or_default(), + consensus_pubkey: consensus_pubkey__, + jailed: jailed__.unwrap_or_default(), + status: status__.unwrap_or_default(), + tokens: tokens__.unwrap_or_default(), + delegator_shares: delegator_shares__.unwrap_or_default(), + description: description__, + unbonding_height: unbonding_height__.unwrap_or_default(), + unbonding_time: unbonding_time__, + commission: commission__, + min_self_delegation: min_self_delegation__.unwrap_or_default(), + unbonding_on_hold_ref_count: unbonding_on_hold_ref_count__.unwrap_or_default(), + unbonding_ids: unbonding_ids__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.Validator", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ValidatorUpdates { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.ValidatorUpdates", len)?; + if true { + struct_ser.serialize_field("updates", &self.updates)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ValidatorUpdates { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "updates", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Updates, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "updates" => Ok(GeneratedField::Updates), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ValidatorUpdates; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.ValidatorUpdates") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut updates__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Updates => { + if updates__.is_some() { + return Err(serde::de::Error::duplicate_field("updates")); + } + updates__ = Some(map_.next_value()?); + } + } + } + Ok(ValidatorUpdates { + updates: updates__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.staking.v1beta1.ValidatorUpdates", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs index 751795ee..676768a0 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs @@ -1367,6 +1367,27 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.staking.v1beta1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -1404,6 +1425,10 @@ pub mod msg_server { tonic::Response, tonic::Status, >; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1712,6 +1737,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.staking.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.config.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.config.v1.rs new file mode 100644 index 00000000..aff15611 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.config.v1.rs @@ -0,0 +1,14 @@ +// @generated +/// Config is the config object of the x/auth/tx package. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Config { + /// skip_ante_handler defines whether the ante handler registration should be skipped in case an app wants to override + /// this functionality. + #[prost(bool, tag = "1")] + pub skip_ante_handler: bool, + /// skip_post_handler defines whether the post handler registration should be skipped in case an app wants to override + /// this functionality. + #[prost(bool, tag = "2")] + pub skip_post_handler: bool, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.config.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.config.v1.serde.rs new file mode 100644 index 00000000..d4283484 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs index ef809f20..01726bb2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs @@ -14,7 +14,7 @@ pub struct SignatureDescriptors { pub struct SignatureDescriptor { /// public_key is the public key of the signer #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::prost_wkt_types::Any>, #[prost(message, optional, tag = "2")] pub data: ::core::option::Option, /// sequence is the sequence of the account, which describes the diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.serde.rs new file mode 100644 index 00000000..0a8c385c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.serde.rs @@ -0,0 +1,633 @@ +impl serde::Serialize for SignMode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SIGN_MODE_UNSPECIFIED", + Self::Direct => "SIGN_MODE_DIRECT", + Self::Textual => "SIGN_MODE_TEXTUAL", + Self::DirectAux => "SIGN_MODE_DIRECT_AUX", + Self::LegacyAminoJson => "SIGN_MODE_LEGACY_AMINO_JSON", + Self::Eip191 => "SIGN_MODE_EIP_191", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for SignMode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SIGN_MODE_UNSPECIFIED", + "SIGN_MODE_DIRECT", + "SIGN_MODE_TEXTUAL", + "SIGN_MODE_DIRECT_AUX", + "SIGN_MODE_LEGACY_AMINO_JSON", + "SIGN_MODE_EIP_191", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignMode; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "SIGN_MODE_UNSPECIFIED" => Ok(SignMode::Unspecified), + "SIGN_MODE_DIRECT" => Ok(SignMode::Direct), + "SIGN_MODE_TEXTUAL" => Ok(SignMode::Textual), + "SIGN_MODE_DIRECT_AUX" => Ok(SignMode::DirectAux), + "SIGN_MODE_LEGACY_AMINO_JSON" => Ok(SignMode::LegacyAminoJson), + "SIGN_MODE_EIP_191" => Ok(SignMode::Eip191), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for SignatureDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor", len)?; + if let Some(v) = self.public_key.as_ref() { + struct_ser.serialize_field("publicKey", v)?; + } + if let Some(v) = self.data.as_ref() { + struct_ser.serialize_field("data", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignatureDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "public_key", + "publicKey", + "data", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PublicKey, + Data, + Sequence, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), + "data" => Ok(GeneratedField::Data), + "sequence" => Ok(GeneratedField::Sequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignatureDescriptor; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut public_key__ = None; + let mut data__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PublicKey => { + if public_key__.is_some() { + return Err(serde::de::Error::duplicate_field("publicKey")); + } + public_key__ = map_.next_value()?; + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = map_.next_value()?; + } + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(SignatureDescriptor { + public_key: public_key__, + data: data__, + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for signature_descriptor::Data { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.sum.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data", len)?; + if let Some(v) = self.sum.as_ref() { + match v { + signature_descriptor::data::Sum::Single(v) => { + struct_ser.serialize_field("single", v)?; + } + signature_descriptor::data::Sum::Multi(v) => { + struct_ser.serialize_field("multi", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for signature_descriptor::Data { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "single", + "multi", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Single, + Multi, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "single" => Ok(GeneratedField::Single), + "multi" => Ok(GeneratedField::Multi), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = signature_descriptor::Data; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sum__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Single => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("single")); + } + sum__ = map_.next_value::<::core::option::Option<_>>()?.map(signature_descriptor::data::Sum::Single) +; + } + GeneratedField::Multi => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("multi")); + } + sum__ = map_.next_value::<::core::option::Option<_>>()?.map(signature_descriptor::data::Sum::Multi) +; + } + } + } + Ok(signature_descriptor::Data { + sum: sum__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for signature_descriptor::data::Multi { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi", len)?; + if let Some(v) = self.bitarray.as_ref() { + struct_ser.serialize_field("bitarray", v)?; + } + if true { + struct_ser.serialize_field("signatures", &self.signatures)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Multi { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "bitarray", + "signatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bitarray, + Signatures, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "bitarray" => Ok(GeneratedField::Bitarray), + "signatures" => Ok(GeneratedField::Signatures), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = signature_descriptor::data::Multi; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut bitarray__ = None; + let mut signatures__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Bitarray => { + if bitarray__.is_some() { + return Err(serde::de::Error::duplicate_field("bitarray")); + } + bitarray__ = map_.next_value()?; + } + GeneratedField::Signatures => { + if signatures__.is_some() { + return Err(serde::de::Error::duplicate_field("signatures")); + } + signatures__ = Some(map_.next_value()?); + } + } + } + Ok(signature_descriptor::data::Multi { + bitarray: bitarray__, + signatures: signatures__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for signature_descriptor::data::Single { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single", len)?; + if true { + let v = SignMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("signature", pbjson::private::base64::encode(&self.signature).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Single { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "mode", + "signature", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Mode, + Signature, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "mode" => Ok(GeneratedField::Mode), + "signature" => Ok(GeneratedField::Signature), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = signature_descriptor::data::Single; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut mode__ = None; + let mut signature__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Mode => { + if mode__.is_some() { + return Err(serde::de::Error::duplicate_field("mode")); + } + mode__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(signature_descriptor::data::Single { + mode: mode__.unwrap_or_default(), + signature: signature__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignatureDescriptors { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptors", len)?; + if true { + struct_ser.serialize_field("signatures", &self.signatures)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignatureDescriptors { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signatures, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signatures" => Ok(GeneratedField::Signatures), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignatureDescriptors; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptors") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signatures__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signatures => { + if signatures__.is_some() { + return Err(serde::de::Error::duplicate_field("signatures")); + } + signatures__ = Some(map_.next_value()?); + } + } + } + Ok(SignatureDescriptors { + signatures: signatures__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptors", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs index 7bf8ca08..5b9aa006 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs @@ -68,7 +68,7 @@ pub struct SignDocDirectAux { pub body_bytes: ::prost::alloc::vec::Vec, /// public_key is the public key of the signing account. #[prost(message, optional, tag = "2")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::prost_wkt_types::Any>, /// chain_id is the identifier of the chain this transaction targets. /// It prevents signed transactions from being used on another chain by an /// attacker. @@ -100,7 +100,7 @@ pub struct TxBody { /// is referred to as the primary signer and pays the fee for the whole /// transaction. #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, /// memo is any arbitrary note/comment to be added to the transaction. /// WARNING: in clients, any publicly exposed text should not be called memo, /// but should be called `note` instead (see ). @@ -114,12 +114,12 @@ pub struct TxBody { /// when the default options are not sufficient. If any of these are present /// and can't be handled, the transaction will be rejected #[prost(message, repeated, tag = "1023")] - pub extension_options: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub extension_options: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, /// extension_options are arbitrary options that can be added by chains /// when the default options are not sufficient. If any of these are present /// and can't be handled, they will be ignored #[prost(message, repeated, tag = "2047")] - pub non_critical_extension_options: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub non_critical_extension_options: ::prost::alloc::vec::Vec<::prost_wkt_types::Any>, } /// AuthInfo describes the fee and signer modes that are used to sign a /// transaction. @@ -154,7 +154,7 @@ pub struct SignerInfo { /// that already exist in state. If unset, the verifier can use the required \ /// signer address for this position and lookup the public key. #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::prost_wkt_types::Any>, /// mode_info describes the signing mode of the signer and is a nested /// structure to support nested multisig pubkey's #[prost(message, optional, tag = "2")] @@ -400,6 +400,82 @@ pub struct GetBlockWithTxsResponse { #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option, } +/// TxDecodeRequest is the request type for the Service.TxDecode +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxDecodeRequest { + /// tx_bytes is the raw transaction. + #[prost(bytes = "vec", tag = "1")] + pub tx_bytes: ::prost::alloc::vec::Vec, +} +/// TxDecodeResponse is the response type for the +/// Service.TxDecode method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxDecodeResponse { + /// tx is the decoded transaction. + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, +} +/// TxEncodeRequest is the request type for the Service.TxEncode +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxEncodeRequest { + /// tx is the transaction to encode. + #[prost(message, optional, tag = "1")] + pub tx: ::core::option::Option, +} +/// TxEncodeResponse is the response type for the +/// Service.TxEncode method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxEncodeResponse { + /// tx_bytes is the encoded transaction bytes. + #[prost(bytes = "vec", tag = "1")] + pub tx_bytes: ::prost::alloc::vec::Vec, +} +/// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxEncodeAminoRequest { + #[prost(string, tag = "1")] + pub amino_json: ::prost::alloc::string::String, +} +/// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxEncodeAminoResponse { + #[prost(bytes = "vec", tag = "1")] + pub amino_binary: ::prost::alloc::vec::Vec, +} +/// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxDecodeAminoRequest { + #[prost(bytes = "vec", tag = "1")] + pub amino_binary: ::prost::alloc::vec::Vec, +} +/// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino +/// RPC method. +/// +/// Since: cosmos-sdk 0.47 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TxDecodeAminoResponse { + #[prost(string, tag = "1")] + pub amino_json: ::prost::alloc::string::String, +} /// OrderBy defines the sorting order #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -430,8 +506,8 @@ impl OrderBy { pub enum BroadcastMode { /// zero-value for mode ordering Unspecified = 0, - /// BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - /// the tx to be committed in a block. + /// DEPRECATED: use BROADCAST_MODE_SYNC instead, + /// BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. Block = 1, /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for /// a CheckTx execution response only. diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs new file mode 100644 index 00000000..8d305abf --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs @@ -0,0 +1,3835 @@ +impl serde::Serialize for AuthInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.AuthInfo", len)?; + if true { + struct_ser.serialize_field("signerInfos", &self.signer_infos)?; + } + if let Some(v) = self.fee.as_ref() { + struct_ser.serialize_field("fee", v)?; + } + if let Some(v) = self.tip.as_ref() { + struct_ser.serialize_field("tip", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AuthInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer_infos", + "signerInfos", + "fee", + "tip", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignerInfos, + Fee, + Tip, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signerInfos" | "signer_infos" => Ok(GeneratedField::SignerInfos), + "fee" => Ok(GeneratedField::Fee), + "tip" => Ok(GeneratedField::Tip), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AuthInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.AuthInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer_infos__ = None; + let mut fee__ = None; + let mut tip__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SignerInfos => { + if signer_infos__.is_some() { + return Err(serde::de::Error::duplicate_field("signerInfos")); + } + signer_infos__ = Some(map_.next_value()?); + } + GeneratedField::Fee => { + if fee__.is_some() { + return Err(serde::de::Error::duplicate_field("fee")); + } + fee__ = map_.next_value()?; + } + GeneratedField::Tip => { + if tip__.is_some() { + return Err(serde::de::Error::duplicate_field("tip")); + } + tip__ = map_.next_value()?; + } + } + } + Ok(AuthInfo { + signer_infos: signer_infos__.unwrap_or_default(), + fee: fee__, + tip: tip__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.AuthInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AuxSignerData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.AuxSignerData", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.sign_doc.as_ref() { + struct_ser.serialize_field("signDoc", v)?; + } + if true { + let v = super::signing::v1beta1::SignMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sig", pbjson::private::base64::encode(&self.sig).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AuxSignerData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "sign_doc", + "signDoc", + "mode", + "sig", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + SignDoc, + Mode, + Sig, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "signDoc" | "sign_doc" => Ok(GeneratedField::SignDoc), + "mode" => Ok(GeneratedField::Mode), + "sig" => Ok(GeneratedField::Sig), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AuxSignerData; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.AuxSignerData") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut sign_doc__ = None; + let mut mode__ = None; + let mut sig__ = 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::SignDoc => { + if sign_doc__.is_some() { + return Err(serde::de::Error::duplicate_field("signDoc")); + } + sign_doc__ = map_.next_value()?; + } + GeneratedField::Mode => { + if mode__.is_some() { + return Err(serde::de::Error::duplicate_field("mode")); + } + mode__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Sig => { + if sig__.is_some() { + return Err(serde::de::Error::duplicate_field("sig")); + } + sig__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(AuxSignerData { + address: address__.unwrap_or_default(), + sign_doc: sign_doc__, + mode: mode__.unwrap_or_default(), + sig: sig__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.AuxSignerData", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for BroadcastMode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "BROADCAST_MODE_UNSPECIFIED", + Self::Block => "BROADCAST_MODE_BLOCK", + Self::Sync => "BROADCAST_MODE_SYNC", + Self::Async => "BROADCAST_MODE_ASYNC", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for BroadcastMode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "BROADCAST_MODE_UNSPECIFIED", + "BROADCAST_MODE_BLOCK", + "BROADCAST_MODE_SYNC", + "BROADCAST_MODE_ASYNC", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BroadcastMode; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "BROADCAST_MODE_UNSPECIFIED" => Ok(BroadcastMode::Unspecified), + "BROADCAST_MODE_BLOCK" => Ok(BroadcastMode::Block), + "BROADCAST_MODE_SYNC" => Ok(BroadcastMode::Sync), + "BROADCAST_MODE_ASYNC" => Ok(BroadcastMode::Async), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for BroadcastTxRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.v1beta1.BroadcastTxRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txBytes", pbjson::private::base64::encode(&self.tx_bytes).as_str())?; + } + if true { + let v = BroadcastMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for BroadcastTxRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx_bytes", + "txBytes", + "mode", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TxBytes, + Mode, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "txBytes" | "tx_bytes" => Ok(GeneratedField::TxBytes), + "mode" => Ok(GeneratedField::Mode), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BroadcastTxRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.BroadcastTxRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx_bytes__ = None; + let mut mode__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TxBytes => { + if tx_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("txBytes")); + } + tx_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Mode => { + if mode__.is_some() { + return Err(serde::de::Error::duplicate_field("mode")); + } + mode__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(BroadcastTxRequest { + tx_bytes: tx_bytes__.unwrap_or_default(), + mode: mode__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.BroadcastTxRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for BroadcastTxResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.BroadcastTxResponse", len)?; + if let Some(v) = self.tx_response.as_ref() { + struct_ser.serialize_field("txResponse", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for BroadcastTxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx_response", + "txResponse", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TxResponse, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "txResponse" | "tx_response" => Ok(GeneratedField::TxResponse), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BroadcastTxResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.BroadcastTxResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx_response__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TxResponse => { + if tx_response__.is_some() { + return Err(serde::de::Error::duplicate_field("txResponse")); + } + tx_response__ = map_.next_value()?; + } + } + } + Ok(BroadcastTxResponse { + tx_response: tx_response__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.BroadcastTxResponse", FIELDS, GeneratedVisitor) + } +} +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; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.Fee", len)?; + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasLimit", ::alloc::string::ToString::to_string(&self.gas_limit).as_str())?; + } + if true { + struct_ser.serialize_field("payer", &self.payer)?; + } + if true { + struct_ser.serialize_field("granter", &self.granter)?; + } + 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] = &[ + "amount", + "gas_limit", + "gasLimit", + "payer", + "granter", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + GasLimit, + Payer, + Granter, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "gasLimit" | "gas_limit" => Ok(GeneratedField::GasLimit), + "payer" => Ok(GeneratedField::Payer), + "granter" => Ok(GeneratedField::Granter), + _ => 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 cosmos.tx.v1beta1.Fee") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amount__ = None; + let mut gas_limit__ = None; + let mut payer__ = None; + let mut granter__ = 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__ = Some(map_.next_value()?); + } + GeneratedField::GasLimit => { + if gas_limit__.is_some() { + return Err(serde::de::Error::duplicate_field("gasLimit")); + } + gas_limit__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Payer => { + if payer__.is_some() { + return Err(serde::de::Error::duplicate_field("payer")); + } + payer__ = Some(map_.next_value()?); + } + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + } + } + Ok(Fee { + amount: amount__.unwrap_or_default(), + gas_limit: gas_limit__.unwrap_or_default(), + payer: payer__.unwrap_or_default(), + granter: granter__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.Fee", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetBlockWithTxsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.v1beta1.GetBlockWithTxsRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).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 GetBlockWithTxsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + 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 { + "height" => Ok(GeneratedField::Height), + "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 = GetBlockWithTxsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetBlockWithTxsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut pagination__ = 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::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(GetBlockWithTxsRequest { + height: height__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.GetBlockWithTxsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetBlockWithTxsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.GetBlockWithTxsResponse", len)?; + if true { + struct_ser.serialize_field("txs", &self.txs)?; + } + if let Some(v) = self.block_id.as_ref() { + struct_ser.serialize_field("blockId", v)?; + } + if let Some(v) = self.block.as_ref() { + struct_ser.serialize_field("block", v)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetBlockWithTxsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "txs", + "block_id", + "blockId", + "block", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Txs, + BlockId, + Block, + 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 { + "txs" => Ok(GeneratedField::Txs), + "blockId" | "block_id" => Ok(GeneratedField::BlockId), + "block" => Ok(GeneratedField::Block), + "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 = GetBlockWithTxsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetBlockWithTxsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut txs__ = None; + let mut block_id__ = None; + let mut block__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Txs => { + if txs__.is_some() { + return Err(serde::de::Error::duplicate_field("txs")); + } + txs__ = Some(map_.next_value()?); + } + GeneratedField::BlockId => { + if block_id__.is_some() { + return Err(serde::de::Error::duplicate_field("blockId")); + } + block_id__ = map_.next_value()?; + } + GeneratedField::Block => { + if block__.is_some() { + return Err(serde::de::Error::duplicate_field("block")); + } + block__ = map_.next_value()?; + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(GetBlockWithTxsResponse { + txs: txs__.unwrap_or_default(), + block_id: block_id__, + block: block__, + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.GetBlockWithTxsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetTxRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.GetTxRequest", len)?; + if true { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetTxRequest { + #[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 = GetTxRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxRequest") + } + + 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(GetTxRequest { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.GetTxRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetTxResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.v1beta1.GetTxResponse", len)?; + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + if let Some(v) = self.tx_response.as_ref() { + struct_ser.serialize_field("txResponse", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetTxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx", + "tx_response", + "txResponse", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tx, + TxResponse, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "txResponse" | "tx_response" => Ok(GeneratedField::TxResponse), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetTxResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx__ = None; + let mut tx_response__ = 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()?; + } + GeneratedField::TxResponse => { + if tx_response__.is_some() { + return Err(serde::de::Error::duplicate_field("txResponse")); + } + tx_response__ = map_.next_value()?; + } + } + } + Ok(GetTxResponse { + tx: tx__, + tx_response: tx_response__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.GetTxResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetTxsEventRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.GetTxsEventRequest", len)?; + if true { + struct_ser.serialize_field("events", &self.events)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if true { + let v = OrderBy::try_from(self.order_by) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.order_by)))?; + struct_ser.serialize_field("orderBy", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("page", ::alloc::string::ToString::to_string(&self.page).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ::alloc::string::ToString::to_string(&self.limit).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "events", + "pagination", + "order_by", + "orderBy", + "page", + "limit", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Events, + Pagination, + OrderBy, + Page, + Limit, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "events" => Ok(GeneratedField::Events), + "pagination" => Ok(GeneratedField::Pagination), + "orderBy" | "order_by" => Ok(GeneratedField::OrderBy), + "page" => Ok(GeneratedField::Page), + "limit" => Ok(GeneratedField::Limit), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GetTxsEventRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxsEventRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut events__ = None; + let mut pagination__ = None; + let mut order_by__ = None; + let mut page__ = None; + let mut limit__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Events => { + if events__.is_some() { + return Err(serde::de::Error::duplicate_field("events")); + } + events__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::OrderBy => { + if order_by__.is_some() { + return Err(serde::de::Error::duplicate_field("orderBy")); + } + order_by__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Page => { + if page__.is_some() { + return Err(serde::de::Error::duplicate_field("page")); + } + page__ = + 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) + ; + } + } + } + Ok(GetTxsEventRequest { + events: events__.unwrap_or_default(), + pagination: pagination__, + order_by: order_by__.unwrap_or_default(), + page: page__.unwrap_or_default(), + limit: limit__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.GetTxsEventRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GetTxsEventResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.GetTxsEventResponse", len)?; + if true { + struct_ser.serialize_field("txs", &self.txs)?; + } + if true { + struct_ser.serialize_field("txResponses", &self.tx_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ::alloc::string::ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GetTxsEventResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "txs", + "tx_responses", + "txResponses", + "pagination", + "total", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Txs, + TxResponses, + Pagination, + 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 { + "txs" => Ok(GeneratedField::Txs), + "txResponses" | "tx_responses" => Ok(GeneratedField::TxResponses), + "pagination" => Ok(GeneratedField::Pagination), + "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 = GetTxsEventResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxsEventResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut txs__ = None; + let mut tx_responses__ = None; + let mut pagination__ = None; + let mut total__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Txs => { + if txs__.is_some() { + return Err(serde::de::Error::duplicate_field("txs")); + } + txs__ = Some(map_.next_value()?); + } + GeneratedField::TxResponses => { + if tx_responses__.is_some() { + return Err(serde::de::Error::duplicate_field("txResponses")); + } + tx_responses__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Total => { + if total__.is_some() { + return Err(serde::de::Error::duplicate_field("total")); + } + total__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(GetTxsEventResponse { + txs: txs__.unwrap_or_default(), + tx_responses: tx_responses__.unwrap_or_default(), + pagination: pagination__, + total: total__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.GetTxsEventResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ModeInfo { + #[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.v1beta1.ModeInfo", len)?; + if let Some(v) = self.sum.as_ref() { + match v { + mode_info::Sum::Single(v) => { + struct_ser.serialize_field("single", v)?; + } + mode_info::Sum::Multi(v) => { + struct_ser.serialize_field("multi", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModeInfo { + #[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 = ModeInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.ModeInfo") + } + + 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(mode_info::Sum::Single) +; + } + GeneratedField::Multi => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("multi")); + } + sum__ = map_.next_value::<::core::option::Option<_>>()?.map(mode_info::Sum::Multi) +; + } + } + } + Ok(ModeInfo { + sum: sum__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.ModeInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for mode_info::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.v1beta1.ModeInfo.Multi", len)?; + if let Some(v) = self.bitarray.as_ref() { + struct_ser.serialize_field("bitarray", v)?; + } + if true { + struct_ser.serialize_field("modeInfos", &self.mode_infos)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for mode_info::Multi { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "bitarray", + "mode_infos", + "modeInfos", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bitarray, + ModeInfos, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "modeInfos" | "mode_infos" => Ok(GeneratedField::ModeInfos), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = mode_info::Multi; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.ModeInfo.Multi") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut bitarray__ = None; + let mut mode_infos__ = 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::ModeInfos => { + if mode_infos__.is_some() { + return Err(serde::de::Error::duplicate_field("modeInfos")); + } + mode_infos__ = Some(map_.next_value()?); + } + } + } + Ok(mode_info::Multi { + bitarray: bitarray__, + mode_infos: mode_infos__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.ModeInfo.Multi", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for mode_info::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; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.ModeInfo.Single", len)?; + if true { + let v = super::signing::v1beta1::SignMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for mode_info::Single { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "mode", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Mode, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = mode_info::Single; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.ModeInfo.Single") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut mode__ = 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); + } + } + } + Ok(mode_info::Single { + mode: mode__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.ModeInfo.Single", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for OrderBy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "ORDER_BY_UNSPECIFIED", + Self::Asc => "ORDER_BY_ASC", + Self::Desc => "ORDER_BY_DESC", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for OrderBy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ORDER_BY_UNSPECIFIED", + "ORDER_BY_ASC", + "ORDER_BY_DESC", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = OrderBy; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ORDER_BY_UNSPECIFIED" => Ok(OrderBy::Unspecified), + "ORDER_BY_ASC" => Ok(OrderBy::Asc), + "ORDER_BY_DESC" => Ok(OrderBy::Desc), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for SignDoc { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.SignDoc", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("bodyBytes", pbjson::private::base64::encode(&self.body_bytes).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("authInfoBytes", pbjson::private::base64::encode(&self.auth_info_bytes).as_str())?; + } + if true { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("accountNumber", ::alloc::string::ToString::to_string(&self.account_number).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignDoc { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "body_bytes", + "bodyBytes", + "auth_info_bytes", + "authInfoBytes", + "chain_id", + "chainId", + "account_number", + "accountNumber", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BodyBytes, + AuthInfoBytes, + ChainId, + AccountNumber, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "bodyBytes" | "body_bytes" => Ok(GeneratedField::BodyBytes), + "authInfoBytes" | "auth_info_bytes" => Ok(GeneratedField::AuthInfoBytes), + "chainId" | "chain_id" => Ok(GeneratedField::ChainId), + "accountNumber" | "account_number" => Ok(GeneratedField::AccountNumber), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignDoc; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SignDoc") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut body_bytes__ = None; + let mut auth_info_bytes__ = None; + let mut chain_id__ = None; + let mut account_number__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BodyBytes => { + if body_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("bodyBytes")); + } + body_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::AuthInfoBytes => { + if auth_info_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("authInfoBytes")); + } + auth_info_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ChainId => { + if chain_id__.is_some() { + return Err(serde::de::Error::duplicate_field("chainId")); + } + chain_id__ = Some(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) + ; + } + } + } + Ok(SignDoc { + body_bytes: body_bytes__.unwrap_or_default(), + auth_info_bytes: auth_info_bytes__.unwrap_or_default(), + chain_id: chain_id__.unwrap_or_default(), + account_number: account_number__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.SignDoc", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignDocDirectAux { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.SignDocDirectAux", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("bodyBytes", pbjson::private::base64::encode(&self.body_bytes).as_str())?; + } + if let Some(v) = self.public_key.as_ref() { + struct_ser.serialize_field("publicKey", v)?; + } + if true { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("accountNumber", ::alloc::string::ToString::to_string(&self.account_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + if let Some(v) = self.tip.as_ref() { + struct_ser.serialize_field("tip", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignDocDirectAux { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "body_bytes", + "bodyBytes", + "public_key", + "publicKey", + "chain_id", + "chainId", + "account_number", + "accountNumber", + "sequence", + "tip", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BodyBytes, + PublicKey, + ChainId, + AccountNumber, + Sequence, + Tip, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "bodyBytes" | "body_bytes" => Ok(GeneratedField::BodyBytes), + "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), + "chainId" | "chain_id" => Ok(GeneratedField::ChainId), + "accountNumber" | "account_number" => Ok(GeneratedField::AccountNumber), + "sequence" => Ok(GeneratedField::Sequence), + "tip" => Ok(GeneratedField::Tip), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignDocDirectAux; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SignDocDirectAux") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut body_bytes__ = None; + let mut public_key__ = None; + let mut chain_id__ = None; + let mut account_number__ = None; + let mut sequence__ = None; + let mut tip__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BodyBytes => { + if body_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("bodyBytes")); + } + body_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::PublicKey => { + if public_key__.is_some() { + return Err(serde::de::Error::duplicate_field("publicKey")); + } + public_key__ = map_.next_value()?; + } + GeneratedField::ChainId => { + if chain_id__.is_some() { + return Err(serde::de::Error::duplicate_field("chainId")); + } + chain_id__ = Some(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) + ; + } + GeneratedField::Tip => { + if tip__.is_some() { + return Err(serde::de::Error::duplicate_field("tip")); + } + tip__ = map_.next_value()?; + } + } + } + Ok(SignDocDirectAux { + body_bytes: body_bytes__.unwrap_or_default(), + public_key: public_key__, + chain_id: chain_id__.unwrap_or_default(), + account_number: account_number__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + tip: tip__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.SignDocDirectAux", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SignerInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.SignerInfo", len)?; + if let Some(v) = self.public_key.as_ref() { + struct_ser.serialize_field("publicKey", v)?; + } + if let Some(v) = self.mode_info.as_ref() { + struct_ser.serialize_field("modeInfo", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ::alloc::string::ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SignerInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "public_key", + "publicKey", + "mode_info", + "modeInfo", + "sequence", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PublicKey, + ModeInfo, + 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), + "modeInfo" | "mode_info" => Ok(GeneratedField::ModeInfo), + "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 = SignerInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SignerInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut public_key__ = None; + let mut mode_info__ = 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::ModeInfo => { + if mode_info__.is_some() { + return Err(serde::de::Error::duplicate_field("modeInfo")); + } + mode_info__ = 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(SignerInfo { + public_key: public_key__, + mode_info: mode_info__, + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.SignerInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SimulateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.v1beta1.SimulateRequest", len)?; + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txBytes", pbjson::private::base64::encode(&self.tx_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SimulateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx", + "tx_bytes", + "txBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tx, + TxBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "txBytes" | "tx_bytes" => Ok(GeneratedField::TxBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SimulateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SimulateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx__ = None; + let mut tx_bytes__ = 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()?; + } + GeneratedField::TxBytes => { + if tx_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("txBytes")); + } + tx_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(SimulateRequest { + tx: tx__, + tx_bytes: tx_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.SimulateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SimulateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.v1beta1.SimulateResponse", len)?; + if let Some(v) = self.gas_info.as_ref() { + struct_ser.serialize_field("gasInfo", v)?; + } + if let Some(v) = self.result.as_ref() { + struct_ser.serialize_field("result", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SimulateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "gas_info", + "gasInfo", + "result", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GasInfo, + 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 { + "gasInfo" | "gas_info" => Ok(GeneratedField::GasInfo), + "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 = SimulateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SimulateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut gas_info__ = None; + let mut result__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GasInfo => { + if gas_info__.is_some() { + return Err(serde::de::Error::duplicate_field("gasInfo")); + } + gas_info__ = map_.next_value()?; + } + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = map_.next_value()?; + } + } + } + Ok(SimulateResponse { + gas_info: gas_info__, + result: result__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.SimulateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Tip { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.v1beta1.Tip", len)?; + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + if true { + struct_ser.serialize_field("tipper", &self.tipper)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Tip { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "amount", + "tipper", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + Tipper, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "tipper" => Ok(GeneratedField::Tipper), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Tip; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.Tip") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amount__ = None; + let mut tipper__ = 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__ = Some(map_.next_value()?); + } + GeneratedField::Tipper => { + if tipper__.is_some() { + return Err(serde::de::Error::duplicate_field("tipper")); + } + tipper__ = Some(map_.next_value()?); + } + } + } + Ok(Tip { + amount: amount__.unwrap_or_default(), + tipper: tipper__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.Tip", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Tx { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.Tx", len)?; + if let Some(v) = self.body.as_ref() { + struct_ser.serialize_field("body", v)?; + } + if let Some(v) = self.auth_info.as_ref() { + struct_ser.serialize_field("authInfo", v)?; + } + 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 Tx { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "body", + "auth_info", + "authInfo", + "signatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Body, + AuthInfo, + 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 { + "body" => Ok(GeneratedField::Body), + "authInfo" | "auth_info" => Ok(GeneratedField::AuthInfo), + "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 = Tx; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.Tx") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut body__ = None; + let mut auth_info__ = None; + let mut signatures__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Body => { + if body__.is_some() { + return Err(serde::de::Error::duplicate_field("body")); + } + body__ = map_.next_value()?; + } + GeneratedField::AuthInfo => { + if auth_info__.is_some() { + return Err(serde::de::Error::duplicate_field("authInfo")); + } + auth_info__ = map_.next_value()?; + } + 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(Tx { + body: body__, + auth_info: auth_info__, + signatures: signatures__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.Tx", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxBody { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.tx.v1beta1.TxBody", len)?; + if true { + struct_ser.serialize_field("messages", &self.messages)?; + } + if true { + struct_ser.serialize_field("memo", &self.memo)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timeoutHeight", ::alloc::string::ToString::to_string(&self.timeout_height).as_str())?; + } + if true { + struct_ser.serialize_field("extensionOptions", &self.extension_options)?; + } + if true { + struct_ser.serialize_field("nonCriticalExtensionOptions", &self.non_critical_extension_options)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxBody { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "messages", + "memo", + "timeout_height", + "timeoutHeight", + "extension_options", + "extensionOptions", + "non_critical_extension_options", + "nonCriticalExtensionOptions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Messages, + Memo, + TimeoutHeight, + ExtensionOptions, + NonCriticalExtensionOptions, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "memo" => Ok(GeneratedField::Memo), + "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "extensionOptions" | "extension_options" => Ok(GeneratedField::ExtensionOptions), + "nonCriticalExtensionOptions" | "non_critical_extension_options" => Ok(GeneratedField::NonCriticalExtensionOptions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxBody; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxBody") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut messages__ = None; + let mut memo__ = None; + let mut timeout_height__ = None; + let mut extension_options__ = None; + let mut non_critical_extension_options__ = 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::Memo => { + if memo__.is_some() { + return Err(serde::de::Error::duplicate_field("memo")); + } + memo__ = Some(map_.next_value()?); + } + GeneratedField::TimeoutHeight => { + if timeout_height__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutHeight")); + } + timeout_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::ExtensionOptions => { + if extension_options__.is_some() { + return Err(serde::de::Error::duplicate_field("extensionOptions")); + } + extension_options__ = Some(map_.next_value()?); + } + GeneratedField::NonCriticalExtensionOptions => { + if non_critical_extension_options__.is_some() { + return Err(serde::de::Error::duplicate_field("nonCriticalExtensionOptions")); + } + non_critical_extension_options__ = Some(map_.next_value()?); + } + } + } + Ok(TxBody { + messages: messages__.unwrap_or_default(), + memo: memo__.unwrap_or_default(), + timeout_height: timeout_height__.unwrap_or_default(), + extension_options: extension_options__.unwrap_or_default(), + non_critical_extension_options: non_critical_extension_options__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxBody", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxDecodeAminoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxDecodeAminoRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("aminoBinary", pbjson::private::base64::encode(&self.amino_binary).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxDecodeAminoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "amino_binary", + "aminoBinary", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AminoBinary, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "aminoBinary" | "amino_binary" => Ok(GeneratedField::AminoBinary), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxDecodeAminoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeAminoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amino_binary__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AminoBinary => { + if amino_binary__.is_some() { + return Err(serde::de::Error::duplicate_field("aminoBinary")); + } + amino_binary__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(TxDecodeAminoRequest { + amino_binary: amino_binary__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxDecodeAminoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxDecodeAminoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxDecodeAminoResponse", len)?; + if true { + struct_ser.serialize_field("aminoJson", &self.amino_json)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxDecodeAminoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "amino_json", + "aminoJson", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AminoJson, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "aminoJson" | "amino_json" => Ok(GeneratedField::AminoJson), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxDecodeAminoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeAminoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amino_json__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AminoJson => { + if amino_json__.is_some() { + return Err(serde::de::Error::duplicate_field("aminoJson")); + } + amino_json__ = Some(map_.next_value()?); + } + } + } + Ok(TxDecodeAminoResponse { + amino_json: amino_json__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxDecodeAminoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxDecodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxDecodeRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txBytes", pbjson::private::base64::encode(&self.tx_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxDecodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx_bytes", + "txBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TxBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "txBytes" | "tx_bytes" => Ok(GeneratedField::TxBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxDecodeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx_bytes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TxBytes => { + if tx_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("txBytes")); + } + tx_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(TxDecodeRequest { + tx_bytes: tx_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxDecodeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxDecodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxDecodeResponse", len)?; + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxDecodeResponse { + #[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 = TxDecodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxDecodeResponse") + } + + 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(TxDecodeResponse { + tx: tx__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxDecodeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxEncodeAminoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxEncodeAminoRequest", len)?; + if true { + struct_ser.serialize_field("aminoJson", &self.amino_json)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxEncodeAminoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "amino_json", + "aminoJson", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AminoJson, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "aminoJson" | "amino_json" => Ok(GeneratedField::AminoJson), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxEncodeAminoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeAminoRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amino_json__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AminoJson => { + if amino_json__.is_some() { + return Err(serde::de::Error::duplicate_field("aminoJson")); + } + amino_json__ = Some(map_.next_value()?); + } + } + } + Ok(TxEncodeAminoRequest { + amino_json: amino_json__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxEncodeAminoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxEncodeAminoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxEncodeAminoResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("aminoBinary", pbjson::private::base64::encode(&self.amino_binary).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxEncodeAminoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "amino_binary", + "aminoBinary", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AminoBinary, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "aminoBinary" | "amino_binary" => Ok(GeneratedField::AminoBinary), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxEncodeAminoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeAminoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amino_binary__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AminoBinary => { + if amino_binary__.is_some() { + return Err(serde::de::Error::duplicate_field("aminoBinary")); + } + amino_binary__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(TxEncodeAminoResponse { + amino_binary: amino_binary__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxEncodeAminoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxEncodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxEncodeRequest", len)?; + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxEncodeRequest { + #[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 = TxEncodeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeRequest") + } + + 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(TxEncodeRequest { + tx: tx__, + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxEncodeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxEncodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxEncodeResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txBytes", pbjson::private::base64::encode(&self.tx_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for TxEncodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "tx_bytes", + "txBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TxBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "txBytes" | "tx_bytes" => Ok(GeneratedField::TxBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TxEncodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxEncodeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut tx_bytes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TxBytes => { + if tx_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("txBytes")); + } + tx_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(TxEncodeResponse { + tx_bytes: tx_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxEncodeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for TxRaw { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.v1beta1.TxRaw", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("bodyBytes", pbjson::private::base64::encode(&self.body_bytes).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("authInfoBytes", pbjson::private::base64::encode(&self.auth_info_bytes).as_str())?; + } + 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 TxRaw { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "body_bytes", + "bodyBytes", + "auth_info_bytes", + "authInfoBytes", + "signatures", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BodyBytes, + AuthInfoBytes, + 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 { + "bodyBytes" | "body_bytes" => Ok(GeneratedField::BodyBytes), + "authInfoBytes" | "auth_info_bytes" => Ok(GeneratedField::AuthInfoBytes), + "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 = TxRaw; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxRaw") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut body_bytes__ = None; + let mut auth_info_bytes__ = None; + let mut signatures__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BodyBytes => { + if body_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("bodyBytes")); + } + body_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::AuthInfoBytes => { + if auth_info_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("authInfoBytes")); + } + auth_info_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + 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(TxRaw { + body_bytes: body_bytes__.unwrap_or_default(), + auth_info_bytes: auth_info_bytes__.unwrap_or_default(), + signatures: signatures__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.TxRaw", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs index 6afb442d..2ccc5c16 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs @@ -178,6 +178,82 @@ pub mod service_client { )); self.inner.unary(req, path, codec).await } + pub async fn tx_decode( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/TxDecode"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "TxDecode")); + self.inner.unary(req, path, codec).await + } + pub async fn tx_encode( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/TxEncode"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.tx.v1beta1.Service", "TxEncode")); + self.inner.unary(req, path, codec).await + } + pub async fn tx_encode_amino( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/TxEncodeAmino"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.tx.v1beta1.Service", + "TxEncodeAmino", + )); + self.inner.unary(req, path, codec).await + } + pub async fn tx_decode_amino( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/TxDecodeAmino"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.tx.v1beta1.Service", + "TxDecodeAmino", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -208,6 +284,22 @@ pub mod service_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn tx_decode( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn tx_encode( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn tx_encode_amino( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn tx_decode_amino( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct ServiceServer { @@ -477,6 +569,158 @@ pub mod service_server { }; Box::pin(fut) } + "/cosmos.tx.v1beta1.Service/TxDecode" => { + #[allow(non_camel_case_types)] + struct TxDecodeSvc(pub Arc); + impl tonic::server::UnaryService for TxDecodeSvc { + type Response = super::TxDecodeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).tx_decode(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TxDecodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/TxEncode" => { + #[allow(non_camel_case_types)] + struct TxEncodeSvc(pub Arc); + impl tonic::server::UnaryService for TxEncodeSvc { + type Response = super::TxEncodeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).tx_encode(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TxEncodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/TxEncodeAmino" => { + #[allow(non_camel_case_types)] + struct TxEncodeAminoSvc(pub Arc); + impl tonic::server::UnaryService for TxEncodeAminoSvc { + type Response = super::TxEncodeAminoResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).tx_encode_amino(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TxEncodeAminoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.tx.v1beta1.Service/TxDecodeAmino" => { + #[allow(non_camel_case_types)] + struct TxDecodeAminoSvc(pub Arc); + impl tonic::server::UnaryService for TxDecodeAminoSvc { + type Response = super::TxDecodeAminoResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).tx_decode_amino(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = TxDecodeAminoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.module.v1.rs new file mode 100644 index 00000000..835a3698 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.module.v1.rs @@ -0,0 +1,9 @@ +// @generated +/// Module is the config object of the upgrade module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.module.v1.serde.rs new file mode 100644 index 00000000..7aee8176 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/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/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs index cd3ad7d9..089162f3 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs @@ -16,9 +16,8 @@ pub struct Plan { /// If this field is not empty, an error will be thrown. #[deprecated] #[prost(message, optional, tag = "2")] - pub time: ::core::option::Option<::prost_types::Timestamp>, + pub time: ::core::option::Option<::prost_wkt_types::Timestamp>, /// The height at which the upgrade must be performed. - /// Only used if Time is not set. #[prost(int64, tag = "3")] pub height: i64, /// Any application specific upgrade info to be included on-chain @@ -30,7 +29,7 @@ pub struct Plan { /// If this field is not empty, an error will be thrown. #[deprecated] #[prost(message, optional, tag = "5")] - pub upgraded_client_state: ::core::option::Option<::prost_types::Any>, + pub upgraded_client_state: ::core::option::Option<::prost_wkt_types::Any>, } /// SoftwareUpgradeProposal is a gov Content type for initiating a software /// upgrade. @@ -38,10 +37,13 @@ pub struct Plan { /// proposals, see MsgSoftwareUpgrade. #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { + /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// plan of the proposal #[prost(message, optional, tag = "3")] pub plan: ::core::option::Option, } @@ -51,8 +53,10 @@ pub struct SoftwareUpgradeProposal { /// proposals, see MsgCancelUpgrade. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { + /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, } @@ -153,7 +157,7 @@ pub struct QueryAuthorityResponse { /// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgrade { - /// authority is the address of the governance account. + /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, /// plan is the upgrade plan. @@ -170,7 +174,7 @@ pub struct MsgSoftwareUpgradeResponse {} /// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgrade { - /// authority is the address of the governance account. + /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.serde.rs new file mode 100644 index 00000000..de744724 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.serde.rs @@ -0,0 +1,1731 @@ +impl serde::Serialize for CancelSoftwareUpgradeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", len)?; + if true { + struct_ser.serialize_field("title", &self.title)?; + } + if true { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CancelSoftwareUpgradeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CancelSoftwareUpgradeProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut title__ = None; + let mut description__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Title => { + if title__.is_some() { + return Err(serde::de::Error::duplicate_field("title")); + } + title__ = Some(map_.next_value()?); + } + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(CancelSoftwareUpgradeProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ModuleVersion { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.ModuleVersion", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ModuleVersion { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "version", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Version, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "version" => Ok(GeneratedField::Version), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ModuleVersion; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.ModuleVersion") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ModuleVersion { + name: name__.unwrap_or_default(), + version: version__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.ModuleVersion", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCancelUpgrade { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgrade", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCancelUpgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authority", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelUpgrade; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgCancelUpgrade") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCancelUpgrade { + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgrade", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCancelUpgradeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCancelUpgradeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelUpgradeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgCancelUpgradeResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSoftwareUpgrade { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", len)?; + if true { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSoftwareUpgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "authority", + "plan", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Plan, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "plan" => Ok(GeneratedField::Plan), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSoftwareUpgrade; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgSoftwareUpgrade") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut plan__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Plan => { + if plan__.is_some() { + return Err(serde::de::Error::duplicate_field("plan")); + } + plan__ = map_.next_value()?; + } + } + } + Ok(MsgSoftwareUpgrade { + authority: authority__.unwrap_or_default(), + plan: plan__, + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgSoftwareUpgradeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgSoftwareUpgradeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSoftwareUpgradeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgSoftwareUpgradeResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Plan { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.Plan", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.time.as_ref() { + struct_ser.serialize_field("time", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if true { + struct_ser.serialize_field("info", &self.info)?; + } + if let Some(v) = self.upgraded_client_state.as_ref() { + struct_ser.serialize_field("upgradedClientState", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Plan { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "time", + "height", + "info", + "upgraded_client_state", + "upgradedClientState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Time, + Height, + Info, + UpgradedClientState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "time" => Ok(GeneratedField::Time), + "height" => Ok(GeneratedField::Height), + "info" => Ok(GeneratedField::Info), + "upgradedClientState" | "upgraded_client_state" => Ok(GeneratedField::UpgradedClientState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Plan; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.Plan") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut time__ = None; + let mut height__ = None; + let mut info__ = None; + let mut upgraded_client_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Time => { + if time__.is_some() { + return Err(serde::de::Error::duplicate_field("time")); + } + time__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Info => { + if info__.is_some() { + return Err(serde::de::Error::duplicate_field("info")); + } + info__ = Some(map_.next_value()?); + } + GeneratedField::UpgradedClientState => { + if upgraded_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradedClientState")); + } + upgraded_client_state__ = map_.next_value()?; + } + } + } + Ok(Plan { + name: name__.unwrap_or_default(), + time: time__, + height: height__.unwrap_or_default(), + info: info__.unwrap_or_default(), + upgraded_client_state: upgraded_client_state__, + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.Plan", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAppliedPlanRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", len)?; + if true { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAppliedPlanRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAppliedPlanRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAppliedPlanRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAppliedPlanRequest { + name: name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAppliedPlanResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAppliedPlanResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "height", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAppliedPlanResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAppliedPlanResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryAppliedPlanResponse { + height: height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAuthorityRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAuthorityRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAuthorityRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAuthorityRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryAuthorityRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAuthorityResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityResponse", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAuthorityResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAuthorityResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAuthorityResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAuthorityResponse { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCurrentPlanRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCurrentPlanRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCurrentPlanRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryCurrentPlanRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryCurrentPlanRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCurrentPlanResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", len)?; + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCurrentPlanResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "plan", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Plan, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "plan" => Ok(GeneratedField::Plan), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCurrentPlanResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryCurrentPlanResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut plan__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Plan => { + if plan__.is_some() { + return Err(serde::de::Error::duplicate_field("plan")); + } + plan__ = map_.next_value()?; + } + } + } + Ok(QueryCurrentPlanResponse { + plan: plan__, + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryCurrentPlanResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryModuleVersionsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", len)?; + if true { + struct_ser.serialize_field("moduleName", &self.module_name)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryModuleVersionsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module_name", + "moduleName", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleName, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "moduleName" | "module_name" => Ok(GeneratedField::ModuleName), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryModuleVersionsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryModuleVersionsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module_name__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ModuleName => { + if module_name__.is_some() { + return Err(serde::de::Error::duplicate_field("moduleName")); + } + module_name__ = Some(map_.next_value()?); + } + } + } + Ok(QueryModuleVersionsRequest { + module_name: module_name__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryModuleVersionsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", len)?; + if true { + struct_ser.serialize_field("moduleVersions", &self.module_versions)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryModuleVersionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module_versions", + "moduleVersions", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleVersions, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "moduleVersions" | "module_versions" => Ok(GeneratedField::ModuleVersions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryModuleVersionsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryModuleVersionsResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module_versions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ModuleVersions => { + if module_versions__.is_some() { + return Err(serde::de::Error::duplicate_field("moduleVersions")); + } + module_versions__ = Some(map_.next_value()?); + } + } + } + Ok(QueryModuleVersionsResponse { + module_versions: module_versions__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradedConsensusStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("lastHeight", ::alloc::string::ToString::to_string(&self.last_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "last_height", + "lastHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + LastHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "lastHeight" | "last_height" => Ok(GeneratedField::LastHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradedConsensusStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut last_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::LastHeight => { + if last_height__.is_some() { + return Err(serde::de::Error::duplicate_field("lastHeight")); + } + last_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryUpgradedConsensusStateRequest { + last_height: last_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryUpgradedConsensusStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("upgradedConsensusState", pbjson::private::base64::encode(&self.upgraded_consensus_state).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "upgraded_consensus_state", + "upgradedConsensusState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UpgradedConsensusState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "upgradedConsensusState" | "upgraded_consensus_state" => Ok(GeneratedField::UpgradedConsensusState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradedConsensusStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgraded_consensus_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::UpgradedConsensusState => { + if upgraded_consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradedConsensusState")); + } + upgraded_consensus_state__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryUpgradedConsensusStateResponse { + upgraded_consensus_state: upgraded_consensus_state__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SoftwareUpgradeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", len)?; + if true { + struct_ser.serialize_field("title", &self.title)?; + } + if true { + struct_ser.serialize_field("description", &self.description)?; + } + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SoftwareUpgradeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "plan", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Plan, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + "plan" => Ok(GeneratedField::Plan), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SoftwareUpgradeProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.SoftwareUpgradeProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut title__ = None; + let mut description__ = None; + let mut plan__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Title => { + if title__.is_some() { + return Err(serde::de::Error::duplicate_field("title")); + } + title__ = Some(map_.next_value()?); + } + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::Plan => { + if plan__.is_some() { + return Err(serde::de::Error::duplicate_field("plan")); + } + plan__ = map_.next_value()?; + } + } + } + Ok(SoftwareUpgradeProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + plan: plan__, + }) + } + } + deserializer.deserialize_struct("cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.module.v1.rs new file mode 100644 index 00000000..ab758aa7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.module.v1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the config object of the vesting module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.module.v1.serde.rs new file mode 100644 index 00000000..8e3ade09 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.module.v1.serde.rs @@ -0,0 +1,71 @@ +impl serde::Serialize for Module { + #[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.vesting.module.v1.Module", len)?; + 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] = &[ + ]; + + #[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 = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.module.v1.Module") + } + + 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(Module { + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs index 63a56aeb..cd560d53 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs @@ -11,7 +11,6 @@ pub struct BaseVestingAccount { pub delegated_free: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "4")] pub delegated_vesting: ::prost::alloc::vec::Vec, - /// Vesting end time, as unix timestamp (in seconds). #[prost(int64, tag = "5")] pub end_time: i64, } @@ -21,7 +20,6 @@ pub struct BaseVestingAccount { pub struct ContinuousVestingAccount { #[prost(message, optional, tag = "1")] pub base_vesting_account: ::core::option::Option, - /// Vesting start time, as unix timestamp (in seconds). #[prost(int64, tag = "2")] pub start_time: i64, } @@ -36,7 +34,6 @@ pub struct DelayedVestingAccount { /// Period defines a length of time and amount of coins that will vest. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Period { - /// Period duration in seconds. #[prost(int64, tag = "1")] pub length: i64, #[prost(message, repeated, tag = "2")] @@ -73,7 +70,6 @@ pub struct MsgCreateVestingAccount { pub to_address: ::prost::alloc::string::String, #[prost(message, repeated, tag = "3")] pub amount: ::prost::alloc::vec::Vec, - /// end of vesting as unix time (in seconds). #[prost(int64, tag = "4")] pub end_time: i64, #[prost(bool, tag = "5")] @@ -110,7 +106,6 @@ pub struct MsgCreatePeriodicVestingAccount { pub from_address: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub to_address: ::prost::alloc::string::String, - /// start of vesting as unix time (in seconds). #[prost(int64, tag = "3")] pub start_time: i64, #[prost(message, repeated, tag = "4")] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.serde.rs new file mode 100644 index 00000000..70e78aa8 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.serde.rs @@ -0,0 +1,1360 @@ +impl serde::Serialize for BaseVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.vesting.v1beta1.BaseVestingAccount", len)?; + if let Some(v) = self.base_account.as_ref() { + struct_ser.serialize_field("baseAccount", v)?; + } + if true { + struct_ser.serialize_field("originalVesting", &self.original_vesting)?; + } + if true { + struct_ser.serialize_field("delegatedFree", &self.delegated_free)?; + } + if true { + struct_ser.serialize_field("delegatedVesting", &self.delegated_vesting)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endTime", ::alloc::string::ToString::to_string(&self.end_time).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for BaseVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_account", + "baseAccount", + "original_vesting", + "originalVesting", + "delegated_free", + "delegatedFree", + "delegated_vesting", + "delegatedVesting", + "end_time", + "endTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseAccount, + OriginalVesting, + DelegatedFree, + DelegatedVesting, + EndTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "originalVesting" | "original_vesting" => Ok(GeneratedField::OriginalVesting), + "delegatedFree" | "delegated_free" => Ok(GeneratedField::DelegatedFree), + "delegatedVesting" | "delegated_vesting" => Ok(GeneratedField::DelegatedVesting), + "endTime" | "end_time" => Ok(GeneratedField::EndTime), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = BaseVestingAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.BaseVestingAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_account__ = None; + let mut original_vesting__ = None; + let mut delegated_free__ = None; + let mut delegated_vesting__ = None; + let mut end_time__ = 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::OriginalVesting => { + if original_vesting__.is_some() { + return Err(serde::de::Error::duplicate_field("originalVesting")); + } + original_vesting__ = Some(map_.next_value()?); + } + GeneratedField::DelegatedFree => { + if delegated_free__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatedFree")); + } + delegated_free__ = Some(map_.next_value()?); + } + GeneratedField::DelegatedVesting => { + if delegated_vesting__.is_some() { + return Err(serde::de::Error::duplicate_field("delegatedVesting")); + } + delegated_vesting__ = Some(map_.next_value()?); + } + GeneratedField::EndTime => { + if end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("endTime")); + } + end_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(BaseVestingAccount { + base_account: base_account__, + original_vesting: original_vesting__.unwrap_or_default(), + delegated_free: delegated_free__.unwrap_or_default(), + delegated_vesting: delegated_vesting__.unwrap_or_default(), + end_time: end_time__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.BaseVestingAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ContinuousVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.vesting.v1beta1.ContinuousVestingAccount", len)?; + if let Some(v) = self.base_vesting_account.as_ref() { + struct_ser.serialize_field("baseVestingAccount", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startTime", ::alloc::string::ToString::to_string(&self.start_time).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ContinuousVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_vesting_account", + "baseVestingAccount", + "start_time", + "startTime", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseVestingAccount, + StartTime, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "baseVestingAccount" | "base_vesting_account" => Ok(GeneratedField::BaseVestingAccount), + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ContinuousVestingAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.ContinuousVestingAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_vesting_account__ = None; + let mut start_time__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BaseVestingAccount => { + if base_vesting_account__.is_some() { + return Err(serde::de::Error::duplicate_field("baseVestingAccount")); + } + base_vesting_account__ = map_.next_value()?; + } + GeneratedField::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); + } + start_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(ContinuousVestingAccount { + base_vesting_account: base_vesting_account__, + start_time: start_time__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.ContinuousVestingAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for DelayedVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.vesting.v1beta1.DelayedVestingAccount", len)?; + if let Some(v) = self.base_vesting_account.as_ref() { + struct_ser.serialize_field("baseVestingAccount", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for DelayedVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_vesting_account", + "baseVestingAccount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseVestingAccount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "baseVestingAccount" | "base_vesting_account" => Ok(GeneratedField::BaseVestingAccount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DelayedVestingAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.DelayedVestingAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_vesting_account__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BaseVestingAccount => { + if base_vesting_account__.is_some() { + return Err(serde::de::Error::duplicate_field("baseVestingAccount")); + } + base_vesting_account__ = map_.next_value()?; + } + } + } + Ok(DelayedVestingAccount { + base_vesting_account: base_vesting_account__, + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.DelayedVestingAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreatePeriodicVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.vesting.v1beta1.MsgCreatePeriodicVestingAccount", len)?; + if true { + struct_ser.serialize_field("fromAddress", &self.from_address)?; + } + if true { + struct_ser.serialize_field("toAddress", &self.to_address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startTime", ::alloc::string::ToString::to_string(&self.start_time).as_str())?; + } + if true { + struct_ser.serialize_field("vestingPeriods", &self.vesting_periods)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreatePeriodicVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "from_address", + "fromAddress", + "to_address", + "toAddress", + "start_time", + "startTime", + "vesting_periods", + "vestingPeriods", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FromAddress, + ToAddress, + StartTime, + VestingPeriods, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + "vestingPeriods" | "vesting_periods" => Ok(GeneratedField::VestingPeriods), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreatePeriodicVestingAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount") + } + + 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 start_time__ = None; + let mut vesting_periods__ = 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::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); + } + start_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::VestingPeriods => { + if vesting_periods__.is_some() { + return Err(serde::de::Error::duplicate_field("vestingPeriods")); + } + vesting_periods__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreatePeriodicVestingAccount { + from_address: from_address__.unwrap_or_default(), + to_address: to_address__.unwrap_or_default(), + start_time: start_time__.unwrap_or_default(), + vesting_periods: vesting_periods__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreatePeriodicVestingAccountResponse { + #[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.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreatePeriodicVestingAccountResponse { + #[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 = MsgCreatePeriodicVestingAccountResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse") + } + + 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(MsgCreatePeriodicVestingAccountResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreatePermanentLockedAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.vesting.v1beta1.MsgCreatePermanentLockedAccount", 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 MsgCreatePermanentLockedAccount { + #[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 = MsgCreatePermanentLockedAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount") + } + + 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(MsgCreatePermanentLockedAccount { + from_address: from_address__.unwrap_or_default(), + to_address: to_address__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreatePermanentLockedAccountResponse { + #[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.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreatePermanentLockedAccountResponse { + #[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 = MsgCreatePermanentLockedAccountResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse") + } + + 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(MsgCreatePermanentLockedAccountResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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.vesting.v1beta1.MsgCreateVestingAccount", 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)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endTime", ::alloc::string::ToString::to_string(&self.end_time).as_str())?; + } + if true { + struct_ser.serialize_field("delayed", &self.delayed)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "from_address", + "fromAddress", + "to_address", + "toAddress", + "amount", + "end_time", + "endTime", + "delayed", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FromAddress, + ToAddress, + Amount, + EndTime, + Delayed, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "endTime" | "end_time" => Ok(GeneratedField::EndTime), + "delayed" => Ok(GeneratedField::Delayed), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateVestingAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreateVestingAccount") + } + + 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; + let mut end_time__ = None; + let mut delayed__ = 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()?); + } + GeneratedField::EndTime => { + if end_time__.is_some() { + return Err(serde::de::Error::duplicate_field("endTime")); + } + end_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Delayed => { + if delayed__.is_some() { + return Err(serde::de::Error::duplicate_field("delayed")); + } + delayed__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateVestingAccount { + from_address: from_address__.unwrap_or_default(), + to_address: to_address__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + end_time: end_time__.unwrap_or_default(), + delayed: delayed__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.MsgCreateVestingAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCreateVestingAccountResponse { + #[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.vesting.v1beta1.MsgCreateVestingAccountResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCreateVestingAccountResponse { + #[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 = MsgCreateVestingAccountResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") + } + + 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(MsgCreateVestingAccountResponse { + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Period { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.vesting.v1beta1.Period", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("length", ::alloc::string::ToString::to_string(&self.length).as_str())?; + } + if true { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Period { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "length", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Length, + 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 { + "length" => Ok(GeneratedField::Length), + "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 = Period; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.Period") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut length__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Length => { + if length__.is_some() { + return Err(serde::de::Error::duplicate_field("length")); + } + length__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(Period { + length: length__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.Period", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PeriodicVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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.vesting.v1beta1.PeriodicVestingAccount", len)?; + if let Some(v) = self.base_vesting_account.as_ref() { + struct_ser.serialize_field("baseVestingAccount", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("startTime", ::alloc::string::ToString::to_string(&self.start_time).as_str())?; + } + if true { + struct_ser.serialize_field("vestingPeriods", &self.vesting_periods)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PeriodicVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_vesting_account", + "baseVestingAccount", + "start_time", + "startTime", + "vesting_periods", + "vestingPeriods", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseVestingAccount, + StartTime, + VestingPeriods, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "baseVestingAccount" | "base_vesting_account" => Ok(GeneratedField::BaseVestingAccount), + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + "vestingPeriods" | "vesting_periods" => Ok(GeneratedField::VestingPeriods), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PeriodicVestingAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.PeriodicVestingAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_vesting_account__ = None; + let mut start_time__ = None; + let mut vesting_periods__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BaseVestingAccount => { + if base_vesting_account__.is_some() { + return Err(serde::de::Error::duplicate_field("baseVestingAccount")); + } + base_vesting_account__ = map_.next_value()?; + } + GeneratedField::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); + } + start_time__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::VestingPeriods => { + if vesting_periods__.is_some() { + return Err(serde::de::Error::duplicate_field("vestingPeriods")); + } + vesting_periods__ = Some(map_.next_value()?); + } + } + } + Ok(PeriodicVestingAccount { + base_vesting_account: base_vesting_account__, + start_time: start_time__.unwrap_or_default(), + vesting_periods: vesting_periods__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.PeriodicVestingAccount", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PermanentLockedAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.vesting.v1beta1.PermanentLockedAccount", len)?; + if let Some(v) = self.base_vesting_account.as_ref() { + struct_ser.serialize_field("baseVestingAccount", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PermanentLockedAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "base_vesting_account", + "baseVestingAccount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseVestingAccount, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "baseVestingAccount" | "base_vesting_account" => Ok(GeneratedField::BaseVestingAccount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PermanentLockedAccount; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.PermanentLockedAccount") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut base_vesting_account__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BaseVestingAccount => { + if base_vesting_account__.is_some() { + return Err(serde::de::Error::duplicate_field("baseVestingAccount")); + } + base_vesting_account__ = map_.next_value()?; + } + } + } + Ok(PermanentLockedAccount { + base_vesting_account: base_vesting_account__, + }) + } + } + deserializer.deserialize_struct("cosmos.vesting.v1beta1.PermanentLockedAccount", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT b/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT deleted file mode 100644 index 1c5ae582..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT +++ /dev/null @@ -1 +0,0 @@ -v3.0.0 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs deleted file mode 100644 index 51ea652d..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs +++ /dev/null @@ -1,41 +0,0 @@ -/// BaseAccount defines a base account type. It contains all the necessary fields -/// for basic account functionality. Any custom account type should extend this -/// type for additional functionality (e.g. vesting). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BaseAccount { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::prost_types::Any>, - #[prost(uint64, tag = "3")] - pub account_number: u64, - #[prost(uint64, tag = "4")] - pub sequence: u64, -} -/// ModuleAccount defines an account for modules that holds coins on a pool. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ModuleAccount { - #[prost(message, optional, tag = "1")] - pub base_account: ::core::option::Option, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "3")] - pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Params defines the parameters for the auth module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - #[prost(uint64, tag = "1")] - pub max_memo_characters: u64, - #[prost(uint64, tag = "2")] - pub tx_sig_limit: u64, - #[prost(uint64, tag = "3")] - pub tx_size_cost_per_byte: u64, - #[prost(uint64, tag = "4")] - pub sig_verify_cost_ed25519: u64, - #[prost(uint64, tag = "5")] - pub sig_verify_cost_secp256k1: u64, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs deleted file mode 100644 index fa391c8e..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.query.v1beta1.rs +++ /dev/null @@ -1,50 +0,0 @@ -/// PageRequest is to be embedded in gRPC request messages for efficient -/// pagination. Ex: -/// -/// message SomeRequest { -/// Foo some_parameter = 1; -/// PageRequest pagination = 2; -/// } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PageRequest { - /// key is a value returned in PageResponse.next_key to begin - /// querying the next page most efficiently. Only one of offset or key - /// should be set. - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - /// offset is a numeric offset that can be used when key is unavailable. - /// It is less efficient than using key. Only one of offset or key should - /// be set. - #[prost(uint64, tag = "2")] - pub offset: u64, - /// limit is the total number of results to be returned in the result page. - /// If left empty it will default to a value to be set by each app. - #[prost(uint64, tag = "3")] - pub limit: u64, - /// count_total is set to true to indicate that the result set should include - /// a count of the total number of items available for pagination in UIs. - /// count_total is only respected when offset is used. It is ignored when key - /// is set. - #[prost(bool, tag = "4")] - pub count_total: bool, -} -/// PageResponse is to be embedded in gRPC response messages where the -/// corresponding request message has used PageRequest. -/// -/// message SomeResponse { -/// repeated Bar results = 1; -/// PageResponse page = 2; -/// } -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PageResponse { - /// next_key is the key to be passed to PageRequest.key to - /// query the next page most efficiently - #[prost(bytes = "vec", tag = "1")] - pub next_key: ::prost::alloc::vec::Vec, - /// total is total number of results available if PageRequest.count_total - /// was set, its value is undefined otherwise - #[prost(uint64, tag = "2")] - pub total: u64, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs deleted file mode 100644 index 325bf8df..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs +++ /dev/null @@ -1,38 +0,0 @@ -/// Coin defines a token with a denomination and an amount. -/// -/// NOTE: The amount field is an Int which implements the custom method -/// signatures required by gogoproto. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Coin { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -/// DecCoin defines a token with a denomination and a decimal amount. -/// -/// NOTE: The amount field is an Dec which implements the custom method -/// signatures required by gogoproto. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecCoin { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, -} -/// IntProto defines a Protobuf wrapper around an Int object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IntProto { - #[prost(string, tag = "1")] - pub int: ::prost::alloc::string::String, -} -/// DecProto defines a Protobuf wrapper around a Dec object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecProto { - #[prost(string, tag = "1")] - pub dec: ::prost::alloc::string::String, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs deleted file mode 100644 index afd49768..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs +++ /dev/null @@ -1,48 +0,0 @@ -/// Plan specifies information about a planned upgrade and when it should occur. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Plan { - /// Sets the name for the upgrade. This name will be used by the upgraded - /// version of the software to apply any special "on-upgrade" commands during - /// the first BeginBlock method after the upgrade is applied. It is also used - /// to detect whether a software version can handle a given upgrade. If no - /// upgrade handler with this name has been set in the software, it will be - /// assumed that the software is out-of-date when the upgrade Time or Height is - /// reached and the software will exit. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - /// The time after which the upgrade must be performed. - /// Leave set to its zero value to use a pre-defined Height instead. - #[prost(message, optional, tag = "2")] - pub time: ::core::option::Option<::prost_types::Timestamp>, - /// The height at which the upgrade must be performed. - /// Only used if Time is not set. - #[prost(int64, tag = "3")] - pub height: i64, - /// Any application specific upgrade info to be included on-chain - /// such as a git commit that validators could automatically upgrade to - #[prost(string, tag = "4")] - pub info: ::prost::alloc::string::String, -} -/// SoftwareUpgradeProposal is a gov Content type for initiating a software -/// upgrade. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SoftwareUpgradeProposal { - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub plan: ::core::option::Option, -} -/// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -/// upgrade. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CancelSoftwareUpgradeProposal { - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs deleted file mode 100644 index dbee6544..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs +++ /dev/null @@ -1,133 +0,0 @@ -/// Params defines the set of on-chain interchain accounts parameters. -/// The following parameters may be used to disable the controller submodule. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// controller_enabled enables or disables the controller submodule. - #[prost(bool, tag = "1")] - pub controller_enabled: bool, -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query provides defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Params queries all parameters of the ICA controller submodule. - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.controller.v1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.interchain_accounts.controller.v1.Query", - "Params", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs deleted file mode 100644 index f049f24e..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs +++ /dev/null @@ -1,136 +0,0 @@ -/// Params defines the set of on-chain interchain accounts parameters. -/// The following parameters may be used to disable the host submodule. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// host_enabled enables or disables the host submodule. - #[prost(bool, tag = "1")] - pub host_enabled: bool, - /// allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. - #[prost(string, repeated, tag = "2")] - pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query provides defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Params queries all parameters of the ICA host submodule. - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.host.v1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.interchain_accounts.host.v1.Query", - "Params", - )); - self.inner.unary(req, path, codec).await - } - } -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.v1.rs deleted file mode 100644 index 1eef5c48..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.v1.rs +++ /dev/null @@ -1,140 +0,0 @@ -/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterchainAccount { - #[prost(message, optional, tag = "1")] - pub base_account: - ::core::option::Option, - #[prost(string, tag = "2")] - pub account_owner: ::prost::alloc::string::String, -} -/// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterchainAccountPacketData { - #[prost(enumeration = "Type", tag = "1")] - pub r#type: i32, - #[prost(bytes = "vec", tag = "2")] - pub data: ::prost::alloc::vec::Vec, - #[prost(string, tag = "3")] - pub memo: ::prost::alloc::string::String, -} -/// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CosmosTx { - #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, -} -/// Type defines a classification of message issued from a controller chain to its associated interchain accounts -/// host -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum Type { - /// Default zero value enumeration - Unspecified = 0, - /// Execute a transaction on an interchain accounts host chain - ExecuteTx = 1, -} -impl Type { - /// 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 { - Type::Unspecified => "TYPE_UNSPECIFIED", - Type::ExecuteTx => "TYPE_EXECUTE_TX", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "TYPE_EXECUTE_TX" => Some(Self::ExecuteTx), - _ => None, - } - } -} -/// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring -/// See ICS004: -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - /// version defines the ICS27 protocol version - #[prost(string, tag = "1")] - pub version: ::prost::alloc::string::String, - /// controller_connection_id is the connection identifier associated with the controller chain - #[prost(string, tag = "2")] - pub controller_connection_id: ::prost::alloc::string::String, - /// host_connection_id is the connection identifier associated with the host chain - #[prost(string, tag = "3")] - pub host_connection_id: ::prost::alloc::string::String, - /// address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step - /// NOTE: the address field is empty on the OnChanOpenInit handshake step - #[prost(string, tag = "4")] - pub address: ::prost::alloc::string::String, - /// encoding defines the supported codec format - #[prost(string, tag = "5")] - pub encoding: ::prost::alloc::string::String, - /// tx_type defines the type of transactions the interchain account can execute - #[prost(string, tag = "6")] - pub tx_type: ::prost::alloc::string::String, -} -/// GenesisState defines the interchain accounts genesis state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - #[prost(message, optional, tag = "1")] - pub controller_genesis_state: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub host_genesis_state: ::core::option::Option, -} -/// ControllerGenesisState defines the interchain accounts controller genesis state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ControllerGenesisState { - #[prost(message, repeated, tag = "1")] - pub active_channels: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub interchain_accounts: ::prost::alloc::vec::Vec, - #[prost(string, repeated, tag = "3")] - pub ports: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - #[prost(message, optional, tag = "4")] - pub params: ::core::option::Option, -} -/// HostGenesisState defines the interchain accounts host genesis state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HostGenesisState { - #[prost(message, repeated, tag = "1")] - pub active_channels: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub interchain_accounts: ::prost::alloc::vec::Vec, - #[prost(string, tag = "3")] - pub port: ::prost::alloc::string::String, - #[prost(message, optional, tag = "4")] - pub params: ::core::option::Option, -} -/// ActiveChannel contains a connection ID, port ID and associated active channel ID -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ActiveChannel { - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub channel_id: ::prost::alloc::string::String, -} -/// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisteredInterchainAccount { - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub account_address: ::prost::alloc::string::String, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs deleted file mode 100644 index 97d401cf..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs +++ /dev/null @@ -1,435 +0,0 @@ -/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between -/// ICS20 enabled chains. See ICS Spec here: -/// -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransfer { - /// the port on which the packet will be sent - #[prost(string, tag = "1")] - pub source_port: ::prost::alloc::string::String, - /// the channel by which the packet will be sent - #[prost(string, tag = "2")] - pub source_channel: ::prost::alloc::string::String, - /// the tokens to be transferred - #[prost(message, optional, tag = "3")] - pub token: ::core::option::Option, - /// the sender address - #[prost(string, tag = "4")] - pub sender: ::prost::alloc::string::String, - /// the recipient address on the destination chain - #[prost(string, tag = "5")] - pub receiver: ::prost::alloc::string::String, - /// Timeout height relative to the current block height. - /// The timeout is disabled when set to 0. - #[prost(message, optional, tag = "6")] - pub timeout_height: ::core::option::Option, - /// Timeout timestamp in absolute nanoseconds since unix epoch. - /// The timeout is disabled when set to 0. - #[prost(uint64, tag = "7")] - pub timeout_timestamp: u64, -} -/// MsgTransferResponse defines the Msg/Transfer response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransferResponse {} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Msg defines the ibc/transfer Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Transfer defines a rpc handler method for MsgTransfer. - pub async fn transfer( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.applications.transfer.v1.Msg/Transfer"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Msg", - "Transfer", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// DenomTrace contains the base denomination for ICS20 fungible tokens and the -/// source tracing information path. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DenomTrace { - /// path defines the chain of port/channel identifiers used for tracing the - /// source of the fungible token. - #[prost(string, tag = "1")] - pub path: ::prost::alloc::string::String, - /// base denomination of the relayed fungible token. - #[prost(string, tag = "2")] - pub base_denom: ::prost::alloc::string::String, -} -/// Params defines the set of IBC transfer parameters. -/// NOTE: To prevent a single token from being transferred, set the -/// TransfersEnabled parameter to true and then set the bank module's SendEnabled -/// parameter for the denomination to false. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// send_enabled enables or disables all cross-chain token transfers from this - /// chain. - #[prost(bool, tag = "1")] - pub send_enabled: bool, - /// receive_enabled enables or disables all cross-chain token transfers to this - /// chain. - #[prost(bool, tag = "2")] - pub receive_enabled: bool, -} -/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTraceRequest { - /// hash (in hex format) of the denomination trace information. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, -} -/// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTraceResponse { - /// denom_trace returns the requested denomination trace information. - #[prost(message, optional, tag = "1")] - pub denom_trace: ::core::option::Option, -} -/// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTracesRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTracesResponse { - /// denom_traces returns all denominations trace information. - #[prost(message, repeated, tag = "1")] - pub denom_traces: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest {} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// QueryDenomHashRequest is the request type for the Query/DenomHash RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomHashRequest { - /// The denomination trace (\[port_id\]/[channel_id])+/\[denom\] - #[prost(string, tag = "1")] - pub trace: ::prost::alloc::string::String, -} -/// QueryDenomHashResponse is the response type for the Query/DenomHash RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomHashResponse { - /// hash (in hex format) of the denomination trace information. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query provides defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// DenomTrace queries a denomination trace information. - pub async fn denom_trace( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/DenomTrace", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "DenomTrace", - )); - self.inner.unary(req, path, codec).await - } - /// DenomTraces queries all denomination traces. - pub async fn denom_traces( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/DenomTraces", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "DenomTraces", - )); - self.inner.unary(req, path, codec).await - } - /// Params queries all parameters of the ibc-transfer module. - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.applications.transfer.v1.Query/Params"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "Params", - )); - self.inner.unary(req, path, codec).await - } - /// DenomHash queries a denomination hash information. - pub async fn denom_hash( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Query/DenomHash", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "DenomHash", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// GenesisState defines the ibc-transfer genesis state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub denom_traces: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub params: ::core::option::Option, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v2.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v2.rs deleted file mode 100644 index cf073398..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v2.rs +++ /dev/null @@ -1,19 +0,0 @@ -/// FungibleTokenPacketData defines a struct for the packet payload -/// See FungibleTokenPacketData spec: -/// -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct FungibleTokenPacketData { - /// the token denomination to be transferred - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - /// the token amount to be transferred - #[prost(string, tag = "2")] - pub amount: ::prost::alloc::string::String, - /// the sender address - #[prost(string, tag = "3")] - pub sender: ::prost::alloc::string::String, - /// the recipient address on the destination chain - #[prost(string, tag = "4")] - pub receiver: ::prost::alloc::string::String, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs deleted file mode 100644 index dddd8b56..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs +++ /dev/null @@ -1,1591 +0,0 @@ -/// 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Channel { - /// current state of the channel end - #[prost(enumeration = "State", tag = "1")] - pub state: i32, - /// whether the channel is ordered or unordered - #[prost(enumeration = "Order", tag = "2")] - pub ordering: i32, - /// counterparty channel end - #[prost(message, optional, tag = "3")] - pub counterparty: ::core::option::Option, - /// list of connection identifiers, in order, along which packets sent on - /// this channel will travel - #[prost(string, repeated, tag = "4")] - pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// opaque channel version, which is agreed upon during the handshake - #[prost(string, tag = "5")] - pub version: ::prost::alloc::string::String, -} -/// IdentifiedChannel defines a channel with additional port and channel -/// identifier fields. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifiedChannel { - /// current state of the channel end - #[prost(enumeration = "State", tag = "1")] - pub state: i32, - /// whether the channel is ordered or unordered - #[prost(enumeration = "Order", tag = "2")] - pub ordering: i32, - /// counterparty channel end - #[prost(message, optional, tag = "3")] - pub counterparty: ::core::option::Option, - /// list of connection identifiers, in order, along which packets sent on - /// this channel will travel - #[prost(string, repeated, tag = "4")] - pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// opaque channel version, which is agreed upon during the handshake - #[prost(string, tag = "5")] - pub version: ::prost::alloc::string::String, - /// port identifier - #[prost(string, tag = "6")] - pub port_id: ::prost::alloc::string::String, - /// channel identifier - #[prost(string, tag = "7")] - pub channel_id: ::prost::alloc::string::String, -} -/// Counterparty defines a channel end counterparty -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Counterparty { - /// port on the counterparty chain which owns the other end of the channel. - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel end on the counterparty chain - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// Packet defines a type that carries data across different chains through IBC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Packet { - /// number corresponds to the order of sends and receives, where a Packet - /// with an earlier sequence number must be sent and received before a Packet - /// with a later sequence number. - #[prost(uint64, tag = "1")] - pub sequence: u64, - /// identifies the port on the sending chain. - #[prost(string, tag = "2")] - pub source_port: ::prost::alloc::string::String, - /// identifies the channel end on the sending chain. - #[prost(string, tag = "3")] - pub source_channel: ::prost::alloc::string::String, - /// identifies the port on the receiving chain. - #[prost(string, tag = "4")] - pub destination_port: ::prost::alloc::string::String, - /// identifies the channel end on the receiving chain. - #[prost(string, tag = "5")] - pub destination_channel: ::prost::alloc::string::String, - /// actual opaque bytes transferred directly to the application module - #[prost(bytes = "vec", tag = "6")] - pub data: ::prost::alloc::vec::Vec, - /// block height after which the packet times out - #[prost(message, optional, tag = "7")] - pub timeout_height: ::core::option::Option, - /// block timestamp (in nanoseconds) after which the packet times out - #[prost(uint64, tag = "8")] - pub timeout_timestamp: u64, -} -/// PacketState defines the generic type necessary to retrieve and store -/// packet commitments, acknowledgements, and receipts. -/// Caller is responsible for knowing the context necessary to interpret this -/// state as a commitment, acknowledgement, or a receipt. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketState { - /// channel port identifier. - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier. - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence. - #[prost(uint64, tag = "3")] - pub sequence: u64, - /// embedded data that represents packet state. - #[prost(bytes = "vec", tag = "4")] - pub data: ::prost::alloc::vec::Vec, -} -/// Acknowledgement is the recommended acknowledgement format to be used by -/// app-specific protocols. -/// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental -/// conflicts with other protobuf message formats used for acknowledgements. -/// 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: -/// -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Acknowledgement { - /// response contains either a result or an error and must be non-empty - #[prost(oneof = "acknowledgement::Response", tags = "21, 22")] - pub response: ::core::option::Option, -} -/// Nested message and enum types in `Acknowledgement`. -pub mod acknowledgement { - /// response contains either a result or an error and must be non-empty - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Response { - #[prost(bytes, tag = "21")] - Result(::prost::alloc::vec::Vec), - #[prost(string, tag = "22")] - Error(::prost::alloc::string::String), - } -} -/// State defines if a channel is in one of the following states: -/// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum State { - /// Default State - UninitializedUnspecified = 0, - /// A channel has just started the opening handshake. - Init = 1, - /// A channel has acknowledged the handshake step on the counterparty chain. - Tryopen = 2, - /// A channel has completed the handshake. Open channels are - /// ready to send and receive packets. - Open = 3, - /// A channel has been closed and can no longer be used to send or receive - /// packets. - Closed = 4, -} -impl State { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", - State::Init => "STATE_INIT", - State::Tryopen => "STATE_TRYOPEN", - State::Open => "STATE_OPEN", - State::Closed => "STATE_CLOSED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), - "STATE_INIT" => Some(Self::Init), - "STATE_TRYOPEN" => Some(Self::Tryopen), - "STATE_OPEN" => Some(Self::Open), - "STATE_CLOSED" => Some(Self::Closed), - _ => None, - } - } -} -/// Order defines if a channel is ORDERED or UNORDERED -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum Order { - /// zero-value for channel ordering - NoneUnspecified = 0, - /// packets can be delivered in any order, which may differ from the order in - /// which they were sent. - Unordered = 1, - /// packets are delivered exactly in the order which they were sent - Ordered = 2, -} -impl Order { - /// 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 { - Order::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", - Order::Unordered => "ORDER_UNORDERED", - Order::Ordered => "ORDER_ORDERED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "ORDER_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified), - "ORDER_UNORDERED" => Some(Self::Unordered), - "ORDER_ORDERED" => Some(Self::Ordered), - _ => None, - } - } -} -/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It -/// is called by a relayer on Chain A. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenInit { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub channel: ::core::option::Option, - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenInitResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, -} -/// 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenTry { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// in the case of crossing hello's, when both chains call OpenInit, we need - /// the channel identifier of the previous channel in state INIT - #[prost(string, tag = "2")] - pub previous_channel_id: ::prost::alloc::string::String, - /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. - #[prost(message, optional, tag = "3")] - pub channel: ::core::option::Option, - #[prost(string, tag = "4")] - pub counterparty_version: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "5")] - pub proof_init: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "7")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenTryResponse {} -/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -/// the change of channel state to TRYOPEN on Chain B. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenAck { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub counterparty_channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub counterparty_version: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "5")] - pub proof_try: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "7")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenAckResponse {} -/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to -/// acknowledge the change of channel state to OPEN on Chain A. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenConfirm { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "3")] - pub proof_ack: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response -/// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenConfirmResponse {} -/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A -/// to close a channel with Chain B. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseInit { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseInitResponse {} -/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B -/// to acknowledge the change of channel state to CLOSED on Chain A. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseConfirm { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "3")] - pub proof_init: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, -} -/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response -/// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseConfirmResponse {} -/// MsgRecvPacket receives incoming IBC packet -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecvPacket { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub proof_commitment: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, -} -/// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecvPacketResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, -} -/// MsgTimeout receives timed-out packet -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeout { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub proof_unreceived: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub next_sequence_recv: u64, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, -} -/// MsgTimeoutResponse defines the Msg/Timeout response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, -} -/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutOnClose { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub proof_unreceived: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub proof_close: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, - #[prost(uint64, tag = "5")] - pub next_sequence_recv: u64, - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, -} -/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutOnCloseResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, -} -/// MsgAcknowledgement receives incoming IBC acknowledgement -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAcknowledgement { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub acknowledgement: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub proof_acked: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, -} -/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAcknowledgementResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, -} -/// ResponseResultType defines the possible outcomes of the execution of a message -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ResponseResultType { - /// Default zero value enumeration - ResponseResultUnspecified = 0, - /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - ResponseResultNoop = 1, - /// The message was executed successfully - ResponseResultSuccess = 2, -} -impl ResponseResultType { - /// 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 { - ResponseResultType::ResponseResultUnspecified => "RESPONSE_RESULT_UNSPECIFIED", - ResponseResultType::ResponseResultNoop => "RESPONSE_RESULT_NOOP", - ResponseResultType::ResponseResultSuccess => "RESPONSE_RESULT_SUCCESS", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "RESPONSE_RESULT_UNSPECIFIED" => Some(Self::ResponseResultUnspecified), - "RESPONSE_RESULT_NOOP" => Some(Self::ResponseResultNoop), - "RESPONSE_RESULT_SUCCESS" => Some(Self::ResponseResultSuccess), - _ => None, - } - } -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Msg defines the ibc/channel Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - pub async fn channel_open_init( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/ChannelOpenInit"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Msg", - "ChannelOpenInit", - )); - self.inner.unary(req, path, codec).await - } - /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - pub async fn channel_open_try( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/ChannelOpenTry"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenTry")); - self.inner.unary(req, path, codec).await - } - /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - pub async fn channel_open_ack( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/ChannelOpenAck"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenAck")); - self.inner.unary(req, path, codec).await - } - /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - pub async fn channel_open_confirm( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/ChannelOpenConfirm"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Msg", - "ChannelOpenConfirm", - )); - self.inner.unary(req, path, codec).await - } - /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - pub async fn channel_close_init( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/ChannelCloseInit"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Msg", - "ChannelCloseInit", - )); - self.inner.unary(req, path, codec).await - } - /// ChannelCloseConfirm defines a rpc handler method for - /// MsgChannelCloseConfirm. - pub async fn channel_close_confirm( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Msg", - "ChannelCloseConfirm", - )); - self.inner.unary(req, path, codec).await - } - /// RecvPacket defines a rpc handler method for MsgRecvPacket. - pub async fn recv_packet( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/RecvPacket"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "RecvPacket")); - self.inner.unary(req, path, codec).await - } - /// Timeout defines a rpc handler method for MsgTimeout. - pub async fn timeout( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/Timeout"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "Timeout")); - self.inner.unary(req, path, codec).await - } - /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - pub async fn timeout_on_close( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/TimeoutOnClose"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "TimeoutOnClose")); - self.inner.unary(req, path, codec).await - } - /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. - pub async fn acknowledgement( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Msg/Acknowledgement"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Msg", - "Acknowledgement", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// QueryChannelRequest is the request type for the Query/Channel RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelResponse { - /// channel associated with the request identifiers - #[prost(message, optional, tag = "1")] - pub channel: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryChannelsRequest is the request type for the Query/Channels RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelsRequest { - /// pagination request - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryChannelsResponse is the response type for the Query/Channels RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelsResponse { - /// list of stored channels of the chain. - #[prost(message, repeated, tag = "1")] - pub channels: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, - /// query block height - #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, -} -/// QueryConnectionChannelsRequest is the request type for the -/// Query/QueryConnectionChannels RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionChannelsRequest { - /// connection unique identifier - #[prost(string, tag = "1")] - pub connection: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryConnectionChannelsResponse is the Response type for the -/// Query/QueryConnectionChannels RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionChannelsResponse { - /// list of channels associated with a connection. - #[prost(message, repeated, tag = "1")] - pub channels: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, - /// query block height - #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, -} -/// QueryChannelClientStateRequest is the request type for the Query/ClientState -/// RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelClientStateRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QueryChannelClientStateResponse is the Response type for the -/// Query/QueryChannelClientState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelClientStateResponse { - /// client state associated with the channel - #[prost(message, optional, tag = "1")] - pub identified_client_state: - ::core::option::Option, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryChannelConsensusStateRequest is the request type for the -/// Query/ConsensusState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelConsensusStateRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// revision number of the consensus state - #[prost(uint64, tag = "3")] - pub revision_number: u64, - /// revision height of the consensus state - #[prost(uint64, tag = "4")] - pub revision_height: u64, -} -/// QueryChannelClientStateResponse is the Response type for the -/// Query/QueryChannelClientState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelConsensusStateResponse { - /// consensus state associated with the channel - #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// client ID associated with the consensus state - #[prost(string, tag = "2")] - pub client_id: ::prost::alloc::string::String, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, -} -/// QueryPacketCommitmentRequest is the request type for the -/// Query/PacketCommitment RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - pub sequence: u64, -} -/// QueryPacketCommitmentResponse defines the client query response for a packet -/// which also includes a proof and the height from which the proof was -/// retrieved -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentResponse { - /// packet associated with the request fields - #[prost(bytes = "vec", tag = "1")] - pub commitment: ::prost::alloc::vec::Vec, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryPacketCommitmentsRequest is the request type for the -/// Query/QueryPacketCommitments RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentsRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryPacketCommitmentsResponse is the request type for the -/// Query/QueryPacketCommitments RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentsResponse { - #[prost(message, repeated, tag = "1")] - pub commitments: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, - /// query block height - #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, -} -/// QueryPacketReceiptRequest is the request type for the -/// Query/PacketReceipt RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketReceiptRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - pub sequence: u64, -} -/// QueryPacketReceiptResponse defines the client query response for a packet -/// receipt which also includes a proof, and the height from which the proof was -/// retrieved -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketReceiptResponse { - /// success flag for if receipt exists - #[prost(bool, tag = "2")] - pub received: bool, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, -} -/// QueryPacketAcknowledgementRequest is the request type for the -/// Query/PacketAcknowledgement RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - pub sequence: u64, -} -/// QueryPacketAcknowledgementResponse defines the client query response for a -/// packet which also includes a proof and the height from which the -/// proof was retrieved -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementResponse { - /// packet associated with the request fields - #[prost(bytes = "vec", tag = "1")] - pub acknowledgement: ::prost::alloc::vec::Vec, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryPacketAcknowledgementsRequest is the request type for the -/// Query/QueryPacketCommitments RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementsRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - /// list of packet sequences - #[prost(uint64, repeated, tag = "4")] - pub packet_commitment_sequences: ::prost::alloc::vec::Vec, -} -/// QueryPacketAcknowledgemetsResponse is the request type for the -/// Query/QueryPacketAcknowledgements RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementsResponse { - #[prost(message, repeated, tag = "1")] - pub acknowledgements: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, - /// query block height - #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, -} -/// QueryUnreceivedPacketsRequest is the request type for the -/// Query/UnreceivedPackets RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedPacketsRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// list of packet sequences - #[prost(uint64, repeated, tag = "3")] - pub packet_commitment_sequences: ::prost::alloc::vec::Vec, -} -/// QueryUnreceivedPacketsResponse is the response type for the -/// Query/UnreceivedPacketCommitments RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedPacketsResponse { - /// list of unreceived packet sequences - #[prost(uint64, repeated, tag = "1")] - pub sequences: ::prost::alloc::vec::Vec, - /// query block height - #[prost(message, optional, tag = "2")] - pub height: ::core::option::Option, -} -/// QueryUnreceivedAcks is the request type for the -/// Query/UnreceivedAcks RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedAcksRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// list of acknowledgement sequences - #[prost(uint64, repeated, tag = "3")] - pub packet_ack_sequences: ::prost::alloc::vec::Vec, -} -/// QueryUnreceivedAcksResponse is the response type for the -/// Query/UnreceivedAcks RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedAcksResponse { - /// list of unreceived acknowledgement sequences - #[prost(uint64, repeated, tag = "1")] - pub sequences: ::prost::alloc::vec::Vec, - /// query block height - #[prost(message, optional, tag = "2")] - pub height: ::core::option::Option, -} -/// QueryNextSequenceReceiveRequest is the request type for the -/// Query/QueryNextSequenceReceiveRequest RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceReceiveRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -/// QuerySequenceResponse is the request type for the -/// Query/QueryNextSequenceReceiveResponse RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceReceiveResponse { - /// next sequence receive number - #[prost(uint64, tag = "1")] - pub next_sequence_receive: u64, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query provides defines the gRPC querier service - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Channel queries an IBC Channel. - pub async fn channel( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Query/Channel"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Channel")); - self.inner.unary(req, path, codec).await - } - /// Channels queries all the IBC channels of a chain. - pub async fn channels( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Query/Channels"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Channels")); - self.inner.unary(req, path, codec).await - } - /// ConnectionChannels queries all the channels associated with a connection - /// end. - pub async fn connection_channels( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ConnectionChannels", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "ConnectionChannels", - )); - self.inner.unary(req, path, codec).await - } - /// ChannelClientState queries for the client state for the channel associated - /// with the provided channel identifiers. - pub async fn channel_client_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelClientState", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "ChannelClientState", - )); - self.inner.unary(req, path, codec).await - } - /// ChannelConsensusState queries for the consensus state for the channel - /// associated with the provided channel identifiers. - pub async fn channel_consensus_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelConsensusState", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "ChannelConsensusState", - )); - self.inner.unary(req, path, codec).await - } - /// PacketCommitment queries a stored packet commitment hash. - pub async fn packet_commitment( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Query/PacketCommitment"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "PacketCommitment", - )); - self.inner.unary(req, path, codec).await - } - /// PacketCommitments returns all the packet commitments hashes associated - /// with a channel. - pub async fn packet_commitments( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketCommitments", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "PacketCommitments", - )); - self.inner.unary(req, path, codec).await - } - /// PacketReceipt queries if a given packet sequence has been received on the - /// queried chain - pub async fn packet_receipt( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Query/PacketReceipt"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "PacketReceipt", - )); - self.inner.unary(req, path, codec).await - } - /// PacketAcknowledgement queries a stored packet acknowledgement hash. - pub async fn packet_acknowledgement( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketAcknowledgement", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "PacketAcknowledgement", - )); - self.inner.unary(req, path, codec).await - } - /// PacketAcknowledgements returns all the packet acknowledgements associated - /// with a channel. - pub async fn packet_acknowledgements( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketAcknowledgements", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "PacketAcknowledgements", - )); - self.inner.unary(req, path, codec).await - } - /// UnreceivedPackets returns all the unreceived IBC packets associated with a - /// channel and sequences. - pub async fn unreceived_packets( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/UnreceivedPackets", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "UnreceivedPackets", - )); - self.inner.unary(req, path, codec).await - } - /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated - /// with a channel and sequences. - pub async fn unreceived_acks( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.channel.v1.Query/UnreceivedAcks"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "UnreceivedAcks", - )); - self.inner.unary(req, path, codec).await - } - /// NextSequenceReceive returns the next receive sequence for a given channel. - pub async fn next_sequence_receive( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/NextSequenceReceive", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.channel.v1.Query", - "NextSequenceReceive", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// GenesisState defines the ibc channel submodule's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - #[prost(message, repeated, tag = "1")] - pub channels: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub acknowledgements: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub commitments: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub receipts: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "5")] - pub send_sequences: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "6")] - pub recv_sequences: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "7")] - pub ack_sequences: ::prost::alloc::vec::Vec, - /// the sequence for the next generated channel identifier - #[prost(uint64, tag = "8")] - pub next_channel_sequence: u64, -} -/// PacketSequence defines the genesis type necessary to retrieve and store -/// next send and receive sequences. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketSequence { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub sequence: u64, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs deleted file mode 100644 index 0000a1fa..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs +++ /dev/null @@ -1,839 +0,0 @@ -/// IdentifiedClientState defines a client state with an additional client -/// identifier field. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifiedClientState { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// client state - #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, -} -/// ConsensusStateWithHeight defines a consensus state with an additional height -/// field. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusStateWithHeight { - /// consensus state height - #[prost(message, optional, tag = "1")] - pub height: ::core::option::Option, - /// consensus state - #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, -} -/// ClientConsensusStates defines all the stored consensus states for a given -/// client. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientConsensusStates { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// consensus states and their heights associated with the client - #[prost(message, repeated, tag = "2")] - pub consensus_states: ::prost::alloc::vec::Vec, -} -/// ClientUpdateProposal is a governance proposal. If it passes, the substitute -/// client's latest consensus state is copied over to the subject client. The proposal -/// handler may fail if the subject and the substitute do not match in client and -/// chain parameters (with exception to latest height, frozen height, and chain-id). -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientUpdateProposal { - /// the title of the update proposal - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// the description of the proposal - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// the client identifier for the client to be updated if the proposal passes - #[prost(string, tag = "3")] - pub subject_client_id: ::prost::alloc::string::String, - /// the substitute client identifier for the client standing in for the subject - /// client - #[prost(string, tag = "4")] - pub substitute_client_id: ::prost::alloc::string::String, -} -/// UpgradeProposal is a gov Content type for initiating an IBC breaking -/// upgrade. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpgradeProposal { - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub plan: ::core::option::Option, - /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. - /// This will make the chain commit to the correct upgraded (self) client state - /// before the upgrade occurs, so that connecting chains can verify that the - /// new upgraded client is valid by verifying a proof on the previous version - /// of the chain. This will allow IBC connections to persist smoothly across - /// planned chain upgrades - #[prost(message, optional, tag = "4")] - pub upgraded_client_state: ::core::option::Option<::prost_types::Any>, -} -/// Height is a monotonically increasing data type -/// that can be compared against another Height for the purposes of updating and -/// freezing clients -/// -/// Normally the RevisionHeight is incremented at each height while keeping -/// RevisionNumber the same. However some consensus algorithms may choose to -/// reset the height in certain conditions e.g. hard forks, state-machine -/// breaking changes In these cases, the RevisionNumber is incremented so that -/// height continues to be monitonically increasing even as the RevisionHeight -/// gets reset -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Height { - /// the revision that the client is currently on - #[prost(uint64, tag = "1")] - pub revision_number: u64, - /// the height within the given revision - #[prost(uint64, tag = "2")] - pub revision_height: u64, -} -/// Params defines the set of IBC light client parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// allowed_clients defines the list of allowed client state types. - #[prost(string, repeated, tag = "1")] - pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// MsgCreateClient defines a message to create an IBC client -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClient { - /// light client state - #[prost(message, optional, tag = "1")] - pub client_state: ::core::option::Option<::prost_types::Any>, - /// consensus state associated with the client that corresponds to a given - /// height. - #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgCreateClientResponse defines the Msg/CreateClient response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClientResponse {} -/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -/// the given header. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClient { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// header to update the light client - #[prost(message, optional, tag = "2")] - pub header: ::core::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClientResponse {} -/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client -/// state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClient { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// upgraded client state - #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, - /// upgraded consensus state, only contains enough information to serve as a - /// basis of trust in update logic - #[prost(message, optional, tag = "3")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// proof that old chain committed to new client - #[prost(bytes = "vec", tag = "4")] - pub proof_upgrade_client: ::prost::alloc::vec::Vec, - /// proof that old chain committed to new consensus state - #[prost(bytes = "vec", tag = "5")] - pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, - /// signer address - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, -} -/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClientResponse {} -/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -/// light client misbehaviour. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviour { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// misbehaviour used for freezing the light client - #[prost(message, optional, tag = "2")] - pub misbehaviour: ::core::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, -} -/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -/// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviourResponse {} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Msg defines the ibc/client Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// CreateClient defines a rpc handler method for MsgCreateClient. - pub async fn create_client( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/CreateClient"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "CreateClient")); - self.inner.unary(req, path, codec).await - } - /// UpdateClient defines a rpc handler method for MsgUpdateClient. - pub async fn update_client( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/UpdateClient"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpdateClient")); - self.inner.unary(req, path, codec).await - } - /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. - pub async fn upgrade_client( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/UpgradeClient"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpgradeClient")); - self.inner.unary(req, path, codec).await - } - /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - pub async fn submit_misbehaviour( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/SubmitMisbehaviour"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.client.v1.Msg", - "SubmitMisbehaviour", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// QueryClientStateRequest is the request type for the Query/ClientState RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStateRequest { - /// client state unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, -} -/// 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStateResponse { - /// client state associated with the request identifier - #[prost(message, optional, tag = "1")] - pub client_state: ::core::option::Option<::prost_types::Any>, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryClientStatesRequest is the request type for the Query/ClientStates RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatesRequest { - /// pagination request - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryClientStatesResponse is the response type for the Query/ClientStates RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatesResponse { - /// list of stored ClientStates of the chain. - #[prost(message, repeated, tag = "1")] - pub client_states: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -/// 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStateRequest { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// consensus state revision number - #[prost(uint64, tag = "2")] - pub revision_number: u64, - /// consensus state revision height - #[prost(uint64, tag = "3")] - pub revision_height: u64, - /// latest_height overrrides the height field and queries the latest stored - /// ConsensusState - #[prost(bool, tag = "4")] - pub latest_height: bool, -} -/// QueryConsensusStateResponse is the response type for the Query/ConsensusState -/// RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStateResponse { - /// consensus state associated with the client identifier at the given height - #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStatesRequest { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryConsensusStatesResponse is the response type for the -/// Query/ConsensusStates RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStatesResponse { - /// consensus states associated with the identifier - #[prost(message, repeated, tag = "1")] - pub consensus_states: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -/// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatusRequest { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, -} -/// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC -/// method. It returns the current status of the IBC client. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatusResponse { - #[prost(string, tag = "1")] - pub status: ::prost::alloc::string::String, -} -/// QueryClientParamsRequest is the request type for the Query/ClientParams RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientParamsRequest {} -/// QueryClientParamsResponse is the response type for the Query/ClientParams RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -/// QueryUpgradedClientStateRequest is the request type for the -/// Query/UpgradedClientState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedClientStateRequest {} -/// QueryUpgradedClientStateResponse is the response type for the -/// Query/UpgradedClientState RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedClientStateResponse { - /// client state associated with the request identifier - #[prost(message, optional, tag = "1")] - pub upgraded_client_state: ::core::option::Option<::prost_types::Any>, -} -/// QueryUpgradedConsensusStateRequest is the request type for the -/// Query/UpgradedConsensusState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateRequest {} -/// QueryUpgradedConsensusStateResponse is the response type for the -/// Query/UpgradedConsensusState RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateResponse { - /// Consensus state associated with the request identifier - #[prost(message, optional, tag = "1")] - pub upgraded_consensus_state: ::core::option::Option<::prost_types::Any>, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query provides defines the gRPC querier service - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// ClientState queries an IBC light client. - pub async fn client_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientState"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientState")); - self.inner.unary(req, path, codec).await - } - /// ClientStates queries all the IBC light clients of a chain. - pub async fn client_states( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientStates"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientStates")); - self.inner.unary(req, path, codec).await - } - /// ConsensusState queries a consensus state associated with a client state at - /// a given height. - pub async fn consensus_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ConsensusState"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.client.v1.Query", - "ConsensusState", - )); - self.inner.unary(req, path, codec).await - } - /// ConsensusStates queries all the consensus state associated with a given - /// client. - pub async fn consensus_states( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ConsensusStates"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.client.v1.Query", - "ConsensusStates", - )); - self.inner.unary(req, path, codec).await - } - /// Status queries the status of an IBC client. - pub async fn client_status( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientStatus"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientStatus")); - self.inner.unary(req, path, codec).await - } - /// ClientParams queries all parameters of the ibc client. - pub async fn client_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientParams"); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientParams")); - self.inner.unary(req, path, codec).await - } - /// UpgradedClientState queries an Upgraded IBC light client. - pub async fn upgraded_client_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/UpgradedClientState", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.client.v1.Query", - "UpgradedClientState", - )); - self.inner.unary(req, path, codec).await - } - /// UpgradedConsensusState queries an Upgraded IBC consensus state. - pub async fn upgraded_consensus_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/UpgradedConsensusState", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.client.v1.Query", - "UpgradedConsensusState", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// GenesisState defines the ibc client submodule's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// client states with their corresponding identifiers - #[prost(message, repeated, tag = "1")] - pub clients: ::prost::alloc::vec::Vec, - /// consensus states from each client - #[prost(message, repeated, tag = "2")] - pub clients_consensus: ::prost::alloc::vec::Vec, - /// metadata from each client - #[prost(message, repeated, tag = "3")] - pub clients_metadata: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub params: ::core::option::Option, - /// create localhost on initialization - #[prost(bool, tag = "5")] - pub create_localhost: bool, - /// the sequence for the next generated client identifier - #[prost(uint64, tag = "6")] - pub next_client_sequence: u64, -} -/// GenesisMetadata defines the genesis type for metadata that clients may return -/// with ExportMetadata -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisMetadata { - /// store key of metadata without clientID-prefix - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - /// metadata value - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -/// IdentifiedGenesisMetadata has the client metadata with the corresponding -/// client id. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifiedGenesisMetadata { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub client_metadata: ::prost::alloc::vec::Vec, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs deleted file mode 100644 index db7ce7c5..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs +++ /dev/null @@ -1,37 +0,0 @@ -/// MerkleRoot defines a merkle root hash. -/// In the Cosmos SDK, the AppHash of a block header becomes the root. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MerkleRoot { - #[prost(bytes = "vec", tag = "1")] - pub hash: ::prost::alloc::vec::Vec, -} -/// 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...)) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MerklePrefix { - #[prost(bytes = "vec", tag = "1")] - pub key_prefix: ::prost::alloc::vec::Vec, -} -/// 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 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MerklePath { - #[prost(string, repeated, tag = "1")] - pub key_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// MerkleProof is a wrapper type over a chain of CommitmentProofs. -/// It demonstrates membership or non-membership for an element or set of -/// elements, verifiable in conjunction with a known commitment root. Proofs -/// should be succinct. -/// MerkleProofs are ordered from leaf-to-root -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MerkleProof { - #[prost(message, repeated, tag = "1")] - pub proofs: ::prost::alloc::vec::Vec, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs deleted file mode 100644 index 46ab99ba..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs +++ /dev/null @@ -1,800 +0,0 @@ -/// ConnectionEnd defines a stateful object on a chain connected to another -/// separate one. -/// NOTE: there must only be 2 defined ConnectionEnds to establish -/// a connection between two chains. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConnectionEnd { - /// client associated with this connection. - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// IBC version which can be utilised to determine encodings or protocols for - /// channels or packets utilising this connection. - #[prost(message, repeated, tag = "2")] - pub versions: ::prost::alloc::vec::Vec, - /// current state of the connection end. - #[prost(enumeration = "State", tag = "3")] - pub state: i32, - /// counterparty chain associated with this connection. - #[prost(message, optional, tag = "4")] - pub counterparty: ::core::option::Option, - /// delay period that must pass before a consensus state can be used for - /// packet-verification NOTE: delay period logic is only implemented by some - /// clients. - #[prost(uint64, tag = "5")] - pub delay_period: u64, -} -/// IdentifiedConnection defines a connection with additional connection -/// identifier field. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IdentifiedConnection { - /// connection identifier. - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// client associated with this connection. - #[prost(string, tag = "2")] - pub client_id: ::prost::alloc::string::String, - /// IBC version which can be utilised to determine encodings or protocols for - /// channels or packets utilising this connection - #[prost(message, repeated, tag = "3")] - pub versions: ::prost::alloc::vec::Vec, - /// current state of the connection end. - #[prost(enumeration = "State", tag = "4")] - pub state: i32, - /// counterparty chain associated with this connection. - #[prost(message, optional, tag = "5")] - pub counterparty: ::core::option::Option, - /// delay period associated with this connection. - #[prost(uint64, tag = "6")] - pub delay_period: u64, -} -/// Counterparty defines the counterparty chain associated with a connection end. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Counterparty { - /// identifies the client on the counterparty chain associated with a given - /// connection. - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// identifies the connection end on the counterparty chain associated with a - /// given connection. - #[prost(string, tag = "2")] - pub connection_id: ::prost::alloc::string::String, - /// commitment merkle prefix of the counterparty chain. - #[prost(message, optional, tag = "3")] - pub prefix: ::core::option::Option, -} -/// ClientPaths define all the connection paths for a client state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientPaths { - /// list of connection paths - #[prost(string, repeated, tag = "1")] - pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// ConnectionPaths define all the connection paths for a given client state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConnectionPaths { - /// client state unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// list of connection paths - #[prost(string, repeated, tag = "2")] - pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Version defines the versioning scheme used to negotiate the IBC verison in -/// the connection handshake. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Version { - /// unique version identifier - #[prost(string, tag = "1")] - pub identifier: ::prost::alloc::string::String, - /// list of features compatible with the specified identifier - #[prost(string, repeated, tag = "2")] - pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// Params defines the set of Connection parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the - /// largest amount of time that the chain might reasonably take to produce the next block under normal operating - /// conditions. A safe choice is 3-5x the expected time per block. - #[prost(uint64, tag = "1")] - pub max_expected_time_per_block: u64, -} -/// State defines if a connection is in one of the following states: -/// INIT, TRYOPEN, OPEN or UNINITIALIZED. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum State { - /// Default State - UninitializedUnspecified = 0, - /// A connection end has just started the opening handshake. - Init = 1, - /// A connection end has acknowledged the handshake step on the counterparty - /// chain. - Tryopen = 2, - /// A connection end has completed the handshake. - Open = 3, -} -impl State { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", - State::Init => "STATE_INIT", - State::Tryopen => "STATE_TRYOPEN", - State::Open => "STATE_OPEN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), - "STATE_INIT" => Some(Self::Init), - "STATE_TRYOPEN" => Some(Self::Tryopen), - "STATE_OPEN" => Some(Self::Open), - _ => None, - } - } -} -/// MsgConnectionOpenInit defines the msg sent by an account on Chain A to -/// initialize a connection with Chain B. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenInit { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub counterparty: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub version: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub delay_period: u64, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, -} -/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response -/// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenInitResponse {} -/// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a -/// connection on Chain B. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenTry { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// in the case of crossing hello's, when both chains call OpenInit, we need - /// the connection identifier of the previous connection in state INIT - #[prost(string, tag = "2")] - pub previous_connection_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub client_state: ::core::option::Option<::prost_types::Any>, - #[prost(message, optional, tag = "4")] - pub counterparty: ::core::option::Option, - #[prost(uint64, tag = "5")] - pub delay_period: u64, - #[prost(message, repeated, tag = "6")] - pub counterparty_versions: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "7")] - pub proof_height: ::core::option::Option, - /// proof of the initialization the connection on Chain A: `UNITIALIZED -> - /// INIT` - #[prost(bytes = "vec", tag = "8")] - pub proof_init: ::prost::alloc::vec::Vec, - /// proof of client state included in message - #[prost(bytes = "vec", tag = "9")] - pub proof_client: ::prost::alloc::vec::Vec, - /// proof of client consensus state - #[prost(bytes = "vec", tag = "10")] - pub proof_consensus: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "11")] - pub consensus_height: ::core::option::Option, - #[prost(string, tag = "12")] - pub signer: ::prost::alloc::string::String, -} -/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenTryResponse {} -/// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to -/// acknowledge the change of connection state to TRYOPEN on Chain B. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenAck { - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub counterparty_connection_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub version: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub client_state: ::core::option::Option<::prost_types::Any>, - #[prost(message, optional, tag = "5")] - pub proof_height: ::core::option::Option, - /// proof of the initialization the connection on Chain B: `UNITIALIZED -> - /// TRYOPEN` - #[prost(bytes = "vec", tag = "6")] - pub proof_try: ::prost::alloc::vec::Vec, - /// proof of client state included in message - #[prost(bytes = "vec", tag = "7")] - pub proof_client: ::prost::alloc::vec::Vec, - /// proof of client consensus state - #[prost(bytes = "vec", tag = "8")] - pub proof_consensus: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "9")] - pub consensus_height: ::core::option::Option, - #[prost(string, tag = "10")] - pub signer: ::prost::alloc::string::String, -} -/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenAckResponse {} -/// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to -/// acknowledge the change of connection state to OPEN on Chain A. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenConfirm { - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, - /// proof for the change of the connection state on Chain A: `INIT -> OPEN` - #[prost(bytes = "vec", tag = "2")] - pub proof_ack: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, -} -/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm -/// response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgConnectionOpenConfirmResponse {} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod msg_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Msg defines the ibc/connection Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - MsgClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - pub async fn connection_open_init( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenInit", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Msg", - "ConnectionOpenInit", - )); - self.inner.unary(req, path, codec).await - } - /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - pub async fn connection_open_try( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenTry", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Msg", - "ConnectionOpenTry", - )); - self.inner.unary(req, path, codec).await - } - /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - pub async fn connection_open_ack( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenAck", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Msg", - "ConnectionOpenAck", - )); - self.inner.unary(req, path, codec).await - } - /// ConnectionOpenConfirm defines a rpc handler method for - /// MsgConnectionOpenConfirm. - pub async fn connection_open_confirm( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Msg", - "ConnectionOpenConfirm", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// QueryConnectionRequest is the request type for the Query/Connection RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionRequest { - /// connection unique identifier - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, -} -/// QueryConnectionResponse is the response type for the Query/Connection RPC -/// method. Besides the connection end, it includes a proof and the height from -/// which the proof was retrieved. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionResponse { - /// connection associated with the request identifier - #[prost(message, optional, tag = "1")] - pub connection: ::core::option::Option, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryConnectionsRequest is the request type for the Query/Connections RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionsRequest { - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -/// QueryConnectionsResponse is the response type for the Query/Connections RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionsResponse { - /// list of stored connections of the chain. - #[prost(message, repeated, tag = "1")] - pub connections: ::prost::alloc::vec::Vec, - /// pagination response - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, - /// query block height - #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, -} -/// QueryClientConnectionsRequest is the request type for the -/// Query/ClientConnections RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientConnectionsRequest { - /// client identifier associated with a connection - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, -} -/// QueryClientConnectionsResponse is the response type for the -/// Query/ClientConnections RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientConnectionsResponse { - /// slice of all the connection paths associated with a client. - #[prost(string, repeated, tag = "1")] - pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was generated - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryConnectionClientStateRequest is the request type for the -/// Query/ConnectionClientState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionClientStateRequest { - /// connection identifier - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, -} -/// QueryConnectionClientStateResponse is the response type for the -/// Query/ConnectionClientState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionClientStateResponse { - /// client state associated with the channel - #[prost(message, optional, tag = "1")] - pub identified_client_state: - ::core::option::Option, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, -} -/// QueryConnectionConsensusStateRequest is the request type for the -/// Query/ConnectionConsensusState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionConsensusStateRequest { - /// connection identifier - #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub revision_number: u64, - #[prost(uint64, tag = "3")] - pub revision_height: u64, -} -/// QueryConnectionConsensusStateResponse is the response type for the -/// Query/ConnectionConsensusState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionConsensusStateResponse { - /// consensus state associated with the channel - #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, - /// client ID associated with the consensus state - #[prost(string, tag = "2")] - pub client_id: ::prost::alloc::string::String, - /// merkle proof of existence - #[prost(bytes = "vec", tag = "3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, -} -/// Generated client implementations. -#[cfg(feature = "grpc")] -pub mod query_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::http::Uri; - use tonic::codegen::*; - /// Query provides defines the gRPC querier service - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - #[cfg(feature = "grpc-transport")] - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl QueryClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> QueryClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - >>::Error: - Into + Send + Sync, - { - QueryClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Connection queries an IBC connection end. - pub async fn connection( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.connection.v1.Query/Connection"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Query", - "Connection", - )); - self.inner.unary(req, path, codec).await - } - /// Connections queries all the IBC connections of a chain. - pub async fn connections( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/ibc.core.connection.v1.Query/Connections"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Query", - "Connections", - )); - self.inner.unary(req, path, codec).await - } - /// ClientConnections queries the connection paths associated with a client - /// state. - pub async fn client_connections( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ClientConnections", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Query", - "ClientConnections", - )); - self.inner.unary(req, path, codec).await - } - /// ConnectionClientState queries the client state associated with the - /// connection. - pub async fn connection_client_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionClientState", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Query", - "ConnectionClientState", - )); - self.inner.unary(req, path, codec).await - } - /// ConnectionConsensusState queries the consensus state associated with the - /// connection. - pub async fn connection_consensus_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner.ready().await.map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionConsensusState", - ); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "ibc.core.connection.v1.Query", - "ConnectionConsensusState", - )); - self.inner.unary(req, path, codec).await - } - } -} -/// GenesisState defines the ibc connection submodule's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - #[prost(message, repeated, tag = "1")] - pub connections: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub client_connection_paths: ::prost::alloc::vec::Vec, - /// the sequence for the next generated connection identifier - #[prost(uint64, tag = "3")] - pub next_connection_sequence: u64, - #[prost(message, optional, tag = "4")] - pub params: ::core::option::Option, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.types.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.types.v1.rs deleted file mode 100644 index 9d882d7c..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.types.v1.rs +++ /dev/null @@ -1,14 +0,0 @@ -/// GenesisState defines the ibc module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// ICS002 - Clients genesis state - #[prost(message, optional, tag = "1")] - pub client_genesis: ::core::option::Option, - /// ICS003 - Connections genesis state - #[prost(message, optional, tag = "2")] - pub connection_genesis: ::core::option::Option, - /// ICS004 - Channel genesis state - #[prost(message, optional, tag = "3")] - pub channel_genesis: ::core::option::Option, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs deleted file mode 100644 index 980676d1..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs +++ /dev/null @@ -1,12 +0,0 @@ -/// ClientState defines a loopback (localhost) client. It requires (read-only) -/// access to keys outside the client prefix. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientState { - /// self chain ID - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - /// self latest block height - #[prost(message, optional, tag = "2")] - pub height: ::core::option::Option, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs deleted file mode 100644 index 82b43ca2..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs +++ /dev/null @@ -1,257 +0,0 @@ -/// ClientState defines a solo machine client that tracks the current consensus -/// state and if the client is frozen. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientState { - /// latest sequence of the client state - #[prost(uint64, tag = "1")] - pub sequence: u64, - /// frozen sequence of the solo machine - #[prost(uint64, tag = "2")] - pub frozen_sequence: u64, - #[prost(message, optional, tag = "3")] - pub consensus_state: ::core::option::Option, - /// when set to true, will allow governance to update a solo machine client. - /// The client will be unfrozen if it is frozen. - #[prost(bool, tag = "4")] - pub allow_update_after_proposal: bool, -} -/// ConsensusState defines a solo machine consensus state. The sequence of a -/// consensus state is contained in the "height" key used in storing the -/// consensus state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusState { - /// public key of the solo machine - #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, - /// diversifier allows the same public key to be re-used across different solo - /// machine clients (potentially on different chains) without being considered - /// misbehaviour. - #[prost(string, tag = "2")] - pub diversifier: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub timestamp: u64, -} -/// Header defines a solo machine consensus header -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Header { - /// sequence to update solo machine public key at - #[prost(uint64, tag = "1")] - pub sequence: u64, - #[prost(uint64, tag = "2")] - pub timestamp: u64, - #[prost(bytes = "vec", tag = "3")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub new_public_key: ::core::option::Option<::prost_types::Any>, - #[prost(string, tag = "5")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// Misbehaviour defines misbehaviour for a solo machine which consists -/// of a sequence and two signatures over different messages at that sequence. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Misbehaviour { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub sequence: u64, - #[prost(message, optional, tag = "3")] - pub signature_one: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub signature_two: ::core::option::Option, -} -/// SignatureAndData contains a signature and the data signed over to create that -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignatureAndData { - #[prost(bytes = "vec", tag = "1")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(enumeration = "DataType", tag = "2")] - pub data_type: i32, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "4")] - pub timestamp: u64, -} -/// TimestampedSignatureData contains the signature data and the timestamp of the -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimestampedSignatureData { - #[prost(bytes = "vec", tag = "1")] - pub signature_data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub timestamp: u64, -} -/// SignBytes defines the signed bytes used for signature verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignBytes { - #[prost(uint64, tag = "1")] - pub sequence: u64, - #[prost(uint64, tag = "2")] - pub timestamp: u64, - #[prost(string, tag = "3")] - pub diversifier: ::prost::alloc::string::String, - /// type of the data used - #[prost(enumeration = "DataType", tag = "4")] - pub data_type: i32, - /// marshaled data - #[prost(bytes = "vec", tag = "5")] - pub data: ::prost::alloc::vec::Vec, -} -/// HeaderData returns the SignBytes data for update verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeaderData { - /// header public key - #[prost(message, optional, tag = "1")] - pub new_pub_key: ::core::option::Option<::prost_types::Any>, - /// header diversifier - #[prost(string, tag = "2")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// ClientStateData returns the SignBytes data for client state verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, -} -/// ConsensusStateData returns the SignBytes data for consensus state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, -} -/// ConnectionStateData returns the SignBytes data for connection state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConnectionStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub connection: - ::core::option::Option, -} -/// ChannelStateData returns the SignBytes data for channel state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChannelStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub channel: ::core::option::Option, -} -/// PacketCommitmentData returns the SignBytes data for packet commitment -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketCommitmentData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub commitment: ::prost::alloc::vec::Vec, -} -/// PacketAcknowledgementData returns the SignBytes data for acknowledgement -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketAcknowledgementData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub acknowledgement: ::prost::alloc::vec::Vec, -} -/// PacketReceiptAbsenceData returns the SignBytes data for -/// packet receipt absence verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketReceiptAbsenceData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, -} -/// NextSequenceRecvData returns the SignBytes data for verification of the next -/// sequence to be received. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NextSequenceRecvData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub next_seq_recv: u64, -} -/// DataType defines the type of solo machine proof being created. This is done -/// to preserve uniqueness of different data sign byte encodings. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum DataType { - /// Default State - UninitializedUnspecified = 0, - /// Data type for client state verification - ClientState = 1, - /// Data type for consensus state verification - ConsensusState = 2, - /// Data type for connection state verification - ConnectionState = 3, - /// Data type for channel state verification - ChannelState = 4, - /// Data type for packet commitment verification - PacketCommitment = 5, - /// Data type for packet acknowledgement verification - PacketAcknowledgement = 6, - /// Data type for packet receipt absence verification - PacketReceiptAbsence = 7, - /// Data type for next sequence recv verification - NextSequenceRecv = 8, - /// Data type for header verification - Header = 9, -} -impl DataType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - DataType::ClientState => "DATA_TYPE_CLIENT_STATE", - DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", - DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", - DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", - DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", - DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", - DataType::Header => "DATA_TYPE_HEADER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), - "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), - "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), - "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), - "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), - "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), - "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), - "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), - "DATA_TYPE_HEADER" => Some(Self::Header), - _ => None, - } - } -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v2.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v2.rs deleted file mode 100644 index 879c9322..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v2.rs +++ /dev/null @@ -1,257 +0,0 @@ -/// ClientState defines a solo machine client that tracks the current consensus -/// state and if the client is frozen. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientState { - /// latest sequence of the client state - #[prost(uint64, tag = "1")] - pub sequence: u64, - /// frozen sequence of the solo machine - #[prost(bool, tag = "2")] - pub is_frozen: bool, - #[prost(message, optional, tag = "3")] - pub consensus_state: ::core::option::Option, - /// when set to true, will allow governance to update a solo machine client. - /// The client will be unfrozen if it is frozen. - #[prost(bool, tag = "4")] - pub allow_update_after_proposal: bool, -} -/// ConsensusState defines a solo machine consensus state. The sequence of a -/// consensus state is contained in the "height" key used in storing the -/// consensus state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusState { - /// public key of the solo machine - #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, - /// diversifier allows the same public key to be re-used across different solo - /// machine clients (potentially on different chains) without being considered - /// misbehaviour. - #[prost(string, tag = "2")] - pub diversifier: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub timestamp: u64, -} -/// Header defines a solo machine consensus header -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Header { - /// sequence to update solo machine public key at - #[prost(uint64, tag = "1")] - pub sequence: u64, - #[prost(uint64, tag = "2")] - pub timestamp: u64, - #[prost(bytes = "vec", tag = "3")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub new_public_key: ::core::option::Option<::prost_types::Any>, - #[prost(string, tag = "5")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// Misbehaviour defines misbehaviour for a solo machine which consists -/// of a sequence and two signatures over different messages at that sequence. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Misbehaviour { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub sequence: u64, - #[prost(message, optional, tag = "3")] - pub signature_one: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub signature_two: ::core::option::Option, -} -/// SignatureAndData contains a signature and the data signed over to create that -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignatureAndData { - #[prost(bytes = "vec", tag = "1")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(enumeration = "DataType", tag = "2")] - pub data_type: i32, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "4")] - pub timestamp: u64, -} -/// TimestampedSignatureData contains the signature data and the timestamp of the -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimestampedSignatureData { - #[prost(bytes = "vec", tag = "1")] - pub signature_data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub timestamp: u64, -} -/// SignBytes defines the signed bytes used for signature verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignBytes { - #[prost(uint64, tag = "1")] - pub sequence: u64, - #[prost(uint64, tag = "2")] - pub timestamp: u64, - #[prost(string, tag = "3")] - pub diversifier: ::prost::alloc::string::String, - /// type of the data used - #[prost(enumeration = "DataType", tag = "4")] - pub data_type: i32, - /// marshaled data - #[prost(bytes = "vec", tag = "5")] - pub data: ::prost::alloc::vec::Vec, -} -/// HeaderData returns the SignBytes data for update verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeaderData { - /// header public key - #[prost(message, optional, tag = "1")] - pub new_pub_key: ::core::option::Option<::prost_types::Any>, - /// header diversifier - #[prost(string, tag = "2")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// ClientStateData returns the SignBytes data for client state verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, -} -/// ConsensusStateData returns the SignBytes data for consensus state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, -} -/// ConnectionStateData returns the SignBytes data for connection state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConnectionStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub connection: - ::core::option::Option, -} -/// ChannelStateData returns the SignBytes data for channel state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChannelStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub channel: ::core::option::Option, -} -/// PacketCommitmentData returns the SignBytes data for packet commitment -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketCommitmentData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub commitment: ::prost::alloc::vec::Vec, -} -/// PacketAcknowledgementData returns the SignBytes data for acknowledgement -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketAcknowledgementData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub acknowledgement: ::prost::alloc::vec::Vec, -} -/// PacketReceiptAbsenceData returns the SignBytes data for -/// packet receipt absence verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketReceiptAbsenceData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, -} -/// NextSequenceRecvData returns the SignBytes data for verification of the next -/// sequence to be received. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NextSequenceRecvData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub next_seq_recv: u64, -} -/// DataType defines the type of solo machine proof being created. This is done -/// to preserve uniqueness of different data sign byte encodings. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum DataType { - /// Default State - UninitializedUnspecified = 0, - /// Data type for client state verification - ClientState = 1, - /// Data type for consensus state verification - ConsensusState = 2, - /// Data type for connection state verification - ConnectionState = 3, - /// Data type for channel state verification - ChannelState = 4, - /// Data type for packet commitment verification - PacketCommitment = 5, - /// Data type for packet acknowledgement verification - PacketAcknowledgement = 6, - /// Data type for packet receipt absence verification - PacketReceiptAbsence = 7, - /// Data type for next sequence recv verification - NextSequenceRecv = 8, - /// Data type for header verification - Header = 9, -} -impl DataType { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - DataType::ClientState => "DATA_TYPE_CLIENT_STATE", - DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", - DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", - DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", - DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", - DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", - DataType::Header => "DATA_TYPE_HEADER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), - "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), - "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), - "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), - "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), - "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), - "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), - "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), - "DATA_TYPE_HEADER" => Some(Self::Header), - _ => None, - } - } -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs deleted file mode 100644 index 3a936208..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs +++ /dev/null @@ -1,106 +0,0 @@ -/// ClientState from Tendermint tracks the current validator set, latest height, -/// and a possible frozen height. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientState { - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub trust_level: ::core::option::Option, - /// duration of the period since the LastestTimestamp during which the - /// submitted headers are valid for upgrade - #[prost(message, optional, tag = "3")] - pub trusting_period: ::core::option::Option<::prost_types::Duration>, - /// duration of the staking unbonding period - #[prost(message, optional, tag = "4")] - pub unbonding_period: ::core::option::Option<::prost_types::Duration>, - /// defines how much new (untrusted) header's Time can drift into the future. - #[prost(message, optional, tag = "5")] - pub max_clock_drift: ::core::option::Option<::prost_types::Duration>, - /// Block height when the client was frozen due to a misbehaviour - #[prost(message, optional, tag = "6")] - pub frozen_height: ::core::option::Option, - /// Latest height the client was updated to - #[prost(message, optional, tag = "7")] - pub latest_height: ::core::option::Option, - /// Proof specifications used in verifying counterparty state - #[prost(message, repeated, tag = "8")] - pub proof_specs: ::prost::alloc::vec::Vec, - /// Path at which next upgraded client will be committed. - /// Each element corresponds to the key for a single CommitmentProof in the - /// chained proof. NOTE: ClientState must stored under - /// `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored - /// under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using - /// the default upgrade module, upgrade_path should be \[\]string{"upgrade", - /// "upgradedIBCState"}` - #[prost(string, repeated, tag = "9")] - pub upgrade_path: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// This flag, when set to true, will allow governance to recover a client - /// which has expired - #[prost(bool, tag = "10")] - pub allow_update_after_expiry: bool, - /// This flag, when set to true, will allow governance to unfreeze a client - /// whose chain has experienced a misbehaviour event - #[prost(bool, tag = "11")] - pub allow_update_after_misbehaviour: bool, -} -/// ConsensusState defines the consensus state from Tendermint. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusState { - /// timestamp that corresponds to the block height in which the ConsensusState - /// was stored. - #[prost(message, optional, tag = "1")] - pub timestamp: ::core::option::Option<::prost_types::Timestamp>, - /// commitment root (i.e app hash) - #[prost(message, optional, tag = "2")] - pub root: ::core::option::Option, - #[prost(bytes = "vec", tag = "3")] - pub next_validators_hash: ::prost::alloc::vec::Vec, -} -/// Misbehaviour is a wrapper over two conflicting Headers -/// that implements Misbehaviour interface expected by ICS-02 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Misbehaviour { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub header_1: ::core::option::Option
, - #[prost(message, optional, tag = "3")] - pub header_2: ::core::option::Option
, -} -/// Header defines the Tendermint client consensus Header. -/// It encapsulates all the information necessary to update from a trusted -/// Tendermint ConsensusState. The inclusion of TrustedHeight and -/// TrustedValidators allows this update to process correctly, so long as the -/// ConsensusState for the TrustedHeight exists, this removes race conditions -/// among relayers The SignedHeader and ValidatorSet are the new untrusted update -/// fields for the client. The TrustedHeight is the height of a stored -/// ConsensusState on the client that will be used to verify the new untrusted -/// header. The Trusted ConsensusState must be within the unbonding period of -/// 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. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Header { - #[prost(message, optional, tag = "1")] - pub signed_header: ::core::option::Option<::tendermint_proto::types::SignedHeader>, - #[prost(message, optional, tag = "2")] - pub validator_set: ::core::option::Option<::tendermint_proto::types::ValidatorSet>, - #[prost(message, optional, tag = "3")] - pub trusted_height: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub trusted_validators: ::core::option::Option<::tendermint_proto::types::ValidatorSet>, -} -/// Fraction defines the protobuf message type for tmmath.Fraction that only -/// supports positive values. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Fraction { - #[prost(uint64, tag = "1")] - pub numerator: u64, - #[prost(uint64, tag = "2")] - pub denominator: u64, -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs b/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs deleted file mode 100644 index 0f545e54..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs +++ /dev/null @@ -1,361 +0,0 @@ -/// * -/// ExistenceProof takes a key and a value and a set of steps to perform on it. -/// The result of peforming all these steps will provide a "root hash", which can -/// be compared to the value in a header. -/// -/// Since it is computationally infeasible to produce a hash collission for any of the used -/// cryptographic hash functions, if someone can provide a series of operations to transform -/// a given key and value into a root hash that matches some trusted root, these key and values -/// must be in the referenced merkle tree. -/// -/// The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -/// which should be controlled by a spec. Eg. with lengthOp as NONE, -/// prefix = FOO, key = BAR, value = CHOICE -/// and -/// prefix = F, key = OOBAR, value = CHOICE -/// would produce the same value. -/// -/// With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -/// in the ProofSpec is valuable to prevent this mutability. And why all trees should -/// length-prefix the data before hashing it. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExistenceProof { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub leaf: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub path: ::prost::alloc::vec::Vec, -} -/// -/// NonExistenceProof takes a proof of two neighbors, one left of the desired key, -/// one right of the desired key. If both proofs are valid AND they are neighbors, -/// then there is no valid proof for the given key. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NonExistenceProof { - /// TODO: remove this as unnecessary??? we prove a range - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub left: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub right: ::core::option::Option, -} -/// -/// CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CommitmentProof { - #[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `CommitmentProof`. -pub mod commitment_proof { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::ExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::NonExistenceProof), - #[prost(message, tag = "3")] - Batch(super::BatchProof), - #[prost(message, tag = "4")] - Compressed(super::CompressedBatchProof), - } -} -/// * -/// LeafOp represents the raw key-value data we wish to prove, and -/// must be flexible to represent the internal transformation from -/// the original key-value pairs into the basis hash, for many existing -/// merkle trees. -/// -/// key and value are passed in. So that the signature of this operation is: -/// leafOp(key, value) -> output -/// -/// To process this, first prehash the keys and values if needed (ANY means no hash in this case): -/// hkey = prehashKey(key) -/// hvalue = prehashValue(value) -/// -/// Then combine the bytes, and hash it -/// output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LeafOp { - #[prost(enumeration = "HashOp", tag = "1")] - pub hash: i32, - #[prost(enumeration = "HashOp", tag = "2")] - pub prehash_key: i32, - #[prost(enumeration = "HashOp", tag = "3")] - pub prehash_value: i32, - #[prost(enumeration = "LengthOp", tag = "4")] - pub length: i32, - /// prefix is a fixed bytes that may optionally be included at the beginning to differentiate - /// a leaf node from an inner node. - #[prost(bytes = "vec", tag = "5")] - pub prefix: ::prost::alloc::vec::Vec, -} -/// * -/// InnerOp represents a merkle-proof step that is not a leaf. -/// It represents concatenating two children and hashing them to provide the next result. -/// -/// The result of the previous step is passed in, so the signature of this op is: -/// innerOp(child) -> output -/// -/// The result of applying InnerOp should be: -/// output = op.hash(op.prefix || child || op.suffix) -/// -/// where the || operator is concatenation of binary data, -/// and child is the result of hashing all the tree below this step. -/// -/// Any special data, like prepending child with the length, or prepending the entire operation with -/// some value to differentiate from leaf nodes, should be included in prefix and suffix. -/// If either of prefix or suffix is empty, we just treat it as an empty string -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InnerOp { - #[prost(enumeration = "HashOp", tag = "1")] - pub hash: i32, - #[prost(bytes = "vec", tag = "2")] - pub prefix: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub suffix: ::prost::alloc::vec::Vec, -} -/// * -/// ProofSpec defines what the expected parameters are for a given proof type. -/// This can be stored in the client and used to validate any incoming proofs. -/// -/// verify(ProofSpec, Proof) -> Proof | Error -/// -/// As demonstrated in tests, if we don't fix the algorithm used to calculate the -/// LeafHash for a given tree, there are many possible key-value pairs that can -/// generate a given hash (by interpretting the preimage differently). -/// We need this for proper security, requires client knows a priori what -/// tree format server uses. But not in code, rather a configuration object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProofSpec { - /// any field in the ExistenceProof must be the same as in this spec. - /// except Prefix, which is just the first bytes of prefix (spec can be longer) - #[prost(message, optional, tag = "1")] - pub leaf_spec: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub inner_spec: ::core::option::Option, - /// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - #[prost(int32, tag = "3")] - pub max_depth: i32, - /// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - #[prost(int32, tag = "4")] - pub min_depth: i32, -} -/// -/// InnerSpec contains all store-specific structure info to determine if two proofs from a -/// given store are neighbors. -/// -/// This enables: -/// -/// isLeftMost(spec: InnerSpec, op: InnerOp) -/// isRightMost(spec: InnerSpec, op: InnerOp) -/// isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InnerSpec { - /// Child order is the ordering of the children node, must count from 0 - /// iavl tree is \[0, 1\] (left then right) - /// merk is \[0, 2, 1\] (left, right, here) - #[prost(int32, repeated, tag = "1")] - pub child_order: ::prost::alloc::vec::Vec, - #[prost(int32, tag = "2")] - pub child_size: i32, - #[prost(int32, tag = "3")] - pub min_prefix_length: i32, - #[prost(int32, tag = "4")] - pub max_prefix_length: i32, - /// empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - #[prost(bytes = "vec", tag = "5")] - pub empty_child: ::prost::alloc::vec::Vec, - /// hash is the algorithm that must be used for each InnerOp - #[prost(enumeration = "HashOp", tag = "6")] - pub hash: i32, -} -/// -/// BatchProof is a group of multiple proof types than can be compressed -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchProof { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, -} -/// Use BatchEntry not CommitmentProof, to avoid recursion -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchEntry { - #[prost(oneof = "batch_entry::Proof", tags = "1, 2")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `BatchEntry`. -pub mod batch_entry { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::ExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::NonExistenceProof), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedBatchProof { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub lookup_inners: ::prost::alloc::vec::Vec, -} -/// Use BatchEntry not CommitmentProof, to avoid recursion -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedBatchEntry { - #[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `CompressedBatchEntry`. -pub mod compressed_batch_entry { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::CompressedExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::CompressedNonExistenceProof), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedExistenceProof { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub leaf: ::core::option::Option, - /// these are indexes into the lookup_inners table in CompressedBatchProof - #[prost(int32, repeated, tag = "4")] - pub path: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedNonExistenceProof { - /// TODO: remove this as unnecessary??? we prove a range - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub left: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub right: ::core::option::Option, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum HashOp { - /// NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NoHash = 0, - Sha256 = 1, - Sha512 = 2, - Keccak = 3, - Ripemd160 = 4, - /// ripemd160(sha256(x)) - Bitcoin = 5, -} -impl HashOp { - /// 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 { - HashOp::NoHash => "NO_HASH", - HashOp::Sha256 => "SHA256", - HashOp::Sha512 => "SHA512", - HashOp::Keccak => "KECCAK", - HashOp::Ripemd160 => "RIPEMD160", - HashOp::Bitcoin => "BITCOIN", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NO_HASH" => Some(Self::NoHash), - "SHA256" => Some(Self::Sha256), - "SHA512" => Some(Self::Sha512), - "KECCAK" => Some(Self::Keccak), - "RIPEMD160" => Some(Self::Ripemd160), - "BITCOIN" => Some(Self::Bitcoin), - _ => None, - } - } -} -/// * -/// LengthOp defines how to process the key and value of the LeafOp -/// to include length information. After encoding the length with the given -/// algorithm, the length will be prepended to the key and value bytes. -/// (Each one with it's own encoded length) -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LengthOp { - /// NO_PREFIX don't include any length info - NoPrefix = 0, - /// VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VarProto = 1, - /// VAR_RLP uses rlp int encoding of the length - VarRlp = 2, - /// FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - Fixed32Big = 3, - /// FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - Fixed32Little = 4, - /// FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - Fixed64Big = 5, - /// FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - Fixed64Little = 6, - /// REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - Require32Bytes = 7, - /// REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - Require64Bytes = 8, -} -impl LengthOp { - /// 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 { - LengthOp::NoPrefix => "NO_PREFIX", - LengthOp::VarProto => "VAR_PROTO", - LengthOp::VarRlp => "VAR_RLP", - LengthOp::Fixed32Big => "FIXED32_BIG", - LengthOp::Fixed32Little => "FIXED32_LITTLE", - LengthOp::Fixed64Big => "FIXED64_BIG", - LengthOp::Fixed64Little => "FIXED64_LITTLE", - LengthOp::Require32Bytes => "REQUIRE_32_BYTES", - LengthOp::Require64Bytes => "REQUIRE_64_BYTES", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "NO_PREFIX" => Some(Self::NoPrefix), - "VAR_PROTO" => Some(Self::VarProto), - "VAR_RLP" => Some(Self::VarRlp), - "FIXED32_BIG" => Some(Self::Fixed32Big), - "FIXED32_LITTLE" => Some(Self::Fixed32Little), - "FIXED64_BIG" => Some(Self::Fixed64Big), - "FIXED64_LITTLE" => Some(Self::Fixed64Little), - "REQUIRE_32_BYTES" => Some(Self::Require32Bytes), - "REQUIRE_64_BYTES" => Some(Self::Require64Bytes), - _ => None, - } - } -} diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs index d2ed2ea6..4755e0b1 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs @@ -63,7 +63,7 @@ pub struct ContractInfo { /// Extension is an extension point to store custom metadata within the /// persistence model. #[prost(message, optional, tag = "7")] - pub extension: ::core::option::Option<::prost_types::Any>, + pub extension: ::core::option::Option<::prost_wkt_types::Any>, } /// ContractCodeHistoryEntry metadata to a contract. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs new file mode 100644 index 00000000..564eee12 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs @@ -0,0 +1,7694 @@ +impl serde::Serialize for AbsoluteTxPosition { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.AbsoluteTxPosition", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("blockHeight", ::alloc::string::ToString::to_string(&self.block_height).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txIndex", ::alloc::string::ToString::to_string(&self.tx_index).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AbsoluteTxPosition { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "block_height", + "blockHeight", + "tx_index", + "txIndex", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BlockHeight, + TxIndex, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "blockHeight" | "block_height" => Ok(GeneratedField::BlockHeight), + "txIndex" | "tx_index" => Ok(GeneratedField::TxIndex), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AbsoluteTxPosition; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AbsoluteTxPosition") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut block_height__ = None; + let mut tx_index__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BlockHeight => { + if block_height__.is_some() { + return Err(serde::de::Error::duplicate_field("blockHeight")); + } + block_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::TxIndex => { + if tx_index__.is_some() { + return Err(serde::de::Error::duplicate_field("txIndex")); + } + tx_index__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(AbsoluteTxPosition { + block_height: block_height__.unwrap_or_default(), + tx_index: tx_index__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.AbsoluteTxPosition", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AccessConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.AccessConfig", len)?; + if true { + let v = AccessType::try_from(self.permission) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.permission)))?; + struct_ser.serialize_field("permission", &v)?; + } + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + struct_ser.serialize_field("addresses", &self.addresses)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AccessConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "permission", + "address", + "addresses", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Permission, + Address, + 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 { + "permission" => Ok(GeneratedField::Permission), + "address" => Ok(GeneratedField::Address), + "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 = AccessConfig; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AccessConfig") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut permission__ = None; + let mut address__ = None; + let mut addresses__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Permission => { + if permission__.is_some() { + return Err(serde::de::Error::duplicate_field("permission")); + } + permission__ = Some(map_.next_value::()? as i32); + } + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + GeneratedField::Addresses => { + if addresses__.is_some() { + return Err(serde::de::Error::duplicate_field("addresses")); + } + addresses__ = Some(map_.next_value()?); + } + } + } + Ok(AccessConfig { + permission: permission__.unwrap_or_default(), + address: address__.unwrap_or_default(), + addresses: addresses__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.AccessConfig", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AccessConfigUpdate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.AccessConfigUpdate", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if let Some(v) = self.instantiate_permission.as_ref() { + struct_ser.serialize_field("instantiatePermission", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AccessConfigUpdate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + "instantiate_permission", + "instantiatePermission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + InstantiatePermission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "instantiatePermission" | "instantiate_permission" => Ok(GeneratedField::InstantiatePermission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AccessConfigUpdate; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AccessConfigUpdate") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + let mut instantiate_permission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::InstantiatePermission => { + if instantiate_permission__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiatePermission")); + } + instantiate_permission__ = map_.next_value()?; + } + } + } + Ok(AccessConfigUpdate { + code_id: code_id__.unwrap_or_default(), + instantiate_permission: instantiate_permission__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.AccessConfigUpdate", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for AccessType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "ACCESS_TYPE_UNSPECIFIED", + Self::Nobody => "ACCESS_TYPE_NOBODY", + Self::OnlyAddress => "ACCESS_TYPE_ONLY_ADDRESS", + Self::Everybody => "ACCESS_TYPE_EVERYBODY", + Self::AnyOfAddresses => "ACCESS_TYPE_ANY_OF_ADDRESSES", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for AccessType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ACCESS_TYPE_UNSPECIFIED", + "ACCESS_TYPE_NOBODY", + "ACCESS_TYPE_ONLY_ADDRESS", + "ACCESS_TYPE_EVERYBODY", + "ACCESS_TYPE_ANY_OF_ADDRESSES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AccessType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ACCESS_TYPE_UNSPECIFIED" => Ok(AccessType::Unspecified), + "ACCESS_TYPE_NOBODY" => Ok(AccessType::Nobody), + "ACCESS_TYPE_ONLY_ADDRESS" => Ok(AccessType::OnlyAddress), + "ACCESS_TYPE_EVERYBODY" => Ok(AccessType::Everybody), + "ACCESS_TYPE_ANY_OF_ADDRESSES" => Ok(AccessType::AnyOfAddresses), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for AccessTypeParam { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.AccessTypeParam", len)?; + if true { + let v = AccessType::try_from(self.value) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.value)))?; + struct_ser.serialize_field("value", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for AccessTypeParam { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = AccessTypeParam; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AccessTypeParam") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(AccessTypeParam { + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.AccessTypeParam", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClearAdminProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.ClearAdminProposal", 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("contract", &self.contract)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClearAdminProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "contract", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Contract, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "contract" => Ok(GeneratedField::Contract), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClearAdminProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ClearAdminProposal") + } + + 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 contract__ = 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::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + } + } + Ok(ClearAdminProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.ClearAdminProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Code { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.Code", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if let Some(v) = self.code_info.as_ref() { + struct_ser.serialize_field("codeInfo", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeBytes", pbjson::private::base64::encode(&self.code_bytes).as_str())?; + } + if true { + struct_ser.serialize_field("pinned", &self.pinned)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Code { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + "code_info", + "codeInfo", + "code_bytes", + "codeBytes", + "pinned", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + CodeInfo, + CodeBytes, + Pinned, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "codeInfo" | "code_info" => Ok(GeneratedField::CodeInfo), + "codeBytes" | "code_bytes" => Ok(GeneratedField::CodeBytes), + "pinned" => Ok(GeneratedField::Pinned), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Code; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Code") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + let mut code_info__ = None; + let mut code_bytes__ = None; + let mut pinned__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CodeInfo => { + if code_info__.is_some() { + return Err(serde::de::Error::duplicate_field("codeInfo")); + } + code_info__ = map_.next_value()?; + } + GeneratedField::CodeBytes => { + if code_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("codeBytes")); + } + code_bytes__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Pinned => { + if pinned__.is_some() { + return Err(serde::de::Error::duplicate_field("pinned")); + } + pinned__ = Some(map_.next_value()?); + } + } + } + Ok(Code { + code_id: code_id__.unwrap_or_default(), + code_info: code_info__, + code_bytes: code_bytes__.unwrap_or_default(), + pinned: pinned__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.Code", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CodeInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.CodeInfo", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeHash", pbjson::private::base64::encode(&self.code_hash).as_str())?; + } + if true { + struct_ser.serialize_field("creator", &self.creator)?; + } + if let Some(v) = self.instantiate_config.as_ref() { + struct_ser.serialize_field("instantiateConfig", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CodeInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_hash", + "codeHash", + "creator", + "instantiate_config", + "instantiateConfig", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeHash, + Creator, + InstantiateConfig, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeHash" | "code_hash" => Ok(GeneratedField::CodeHash), + "creator" => Ok(GeneratedField::Creator), + "instantiateConfig" | "instantiate_config" => Ok(GeneratedField::InstantiateConfig), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CodeInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.CodeInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_hash__ = None; + let mut creator__ = None; + let mut instantiate_config__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeHash => { + if code_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("codeHash")); + } + code_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Creator => { + if creator__.is_some() { + return Err(serde::de::Error::duplicate_field("creator")); + } + creator__ = Some(map_.next_value()?); + } + GeneratedField::InstantiateConfig => { + if instantiate_config__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiateConfig")); + } + instantiate_config__ = map_.next_value()?; + } + } + } + Ok(CodeInfo { + code_hash: code_hash__.unwrap_or_default(), + creator: creator__.unwrap_or_default(), + instantiate_config: instantiate_config__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.CodeInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for CodeInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.CodeInfoResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + struct_ser.serialize_field("creator", &self.creator)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("dataHash", pbjson::private::base64::encode(&self.data_hash).as_str())?; + } + if let Some(v) = self.instantiate_permission.as_ref() { + struct_ser.serialize_field("instantiatePermission", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for CodeInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + "creator", + "data_hash", + "dataHash", + "instantiate_permission", + "instantiatePermission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + Creator, + DataHash, + InstantiatePermission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "creator" => Ok(GeneratedField::Creator), + "dataHash" | "data_hash" => Ok(GeneratedField::DataHash), + "instantiatePermission" | "instantiate_permission" => Ok(GeneratedField::InstantiatePermission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = CodeInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.CodeInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + let mut creator__ = None; + let mut data_hash__ = None; + let mut instantiate_permission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Creator => { + if creator__.is_some() { + return Err(serde::de::Error::duplicate_field("creator")); + } + creator__ = Some(map_.next_value()?); + } + GeneratedField::DataHash => { + if data_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("dataHash")); + } + data_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::InstantiatePermission => { + if instantiate_permission__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiatePermission")); + } + instantiate_permission__ = map_.next_value()?; + } + } + } + Ok(CodeInfoResponse { + code_id: code_id__.unwrap_or_default(), + creator: creator__.unwrap_or_default(), + data_hash: data_hash__.unwrap_or_default(), + instantiate_permission: instantiate_permission__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.CodeInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Contract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Contract", len)?; + if true { + struct_ser.serialize_field("contractAddress", &self.contract_address)?; + } + if let Some(v) = self.contract_info.as_ref() { + struct_ser.serialize_field("contractInfo", v)?; + } + if true { + struct_ser.serialize_field("contractState", &self.contract_state)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Contract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "contract_address", + "contractAddress", + "contract_info", + "contractInfo", + "contract_state", + "contractState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ContractAddress, + ContractInfo, + ContractState, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "contractAddress" | "contract_address" => Ok(GeneratedField::ContractAddress), + "contractInfo" | "contract_info" => Ok(GeneratedField::ContractInfo), + "contractState" | "contract_state" => Ok(GeneratedField::ContractState), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Contract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Contract") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut contract_address__ = None; + let mut contract_info__ = None; + let mut contract_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ContractAddress => { + if contract_address__.is_some() { + return Err(serde::de::Error::duplicate_field("contractAddress")); + } + contract_address__ = Some(map_.next_value()?); + } + GeneratedField::ContractInfo => { + if contract_info__.is_some() { + return Err(serde::de::Error::duplicate_field("contractInfo")); + } + contract_info__ = map_.next_value()?; + } + GeneratedField::ContractState => { + if contract_state__.is_some() { + return Err(serde::de::Error::duplicate_field("contractState")); + } + contract_state__ = Some(map_.next_value()?); + } + } + } + Ok(Contract { + contract_address: contract_address__.unwrap_or_default(), + contract_info: contract_info__, + contract_state: contract_state__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.Contract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ContractCodeHistoryEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.ContractCodeHistoryEntry", len)?; + if true { + let v = ContractCodeHistoryOperationType::try_from(self.operation) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.operation)))?; + struct_ser.serialize_field("operation", &v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if let Some(v) = self.updated.as_ref() { + struct_ser.serialize_field("updated", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ContractCodeHistoryEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "operation", + "code_id", + "codeId", + "updated", + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Operation, + CodeId, + Updated, + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "operation" => Ok(GeneratedField::Operation), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "updated" => Ok(GeneratedField::Updated), + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ContractCodeHistoryEntry; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ContractCodeHistoryEntry") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut operation__ = None; + let mut code_id__ = None; + let mut updated__ = None; + let mut msg__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Operation => { + if operation__.is_some() { + return Err(serde::de::Error::duplicate_field("operation")); + } + operation__ = Some(map_.next_value::()? as i32); + } + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Updated => { + if updated__.is_some() { + return Err(serde::de::Error::duplicate_field("updated")); + } + updated__ = map_.next_value()?; + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ContractCodeHistoryEntry { + operation: operation__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + updated: updated__, + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.ContractCodeHistoryEntry", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ContractCodeHistoryOperationType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED", + Self::Init => "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT", + Self::Migrate => "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE", + Self::Genesis => "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for ContractCodeHistoryOperationType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED", + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT", + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE", + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ContractCodeHistoryOperationType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + i32::try_from(v) + .ok() + .and_then(|x| x.try_into().ok()) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED" => Ok(ContractCodeHistoryOperationType::Unspecified), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT" => Ok(ContractCodeHistoryOperationType::Init), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE" => Ok(ContractCodeHistoryOperationType::Migrate), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS" => Ok(ContractCodeHistoryOperationType::Genesis), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for ContractInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.ContractInfo", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + struct_ser.serialize_field("creator", &self.creator)?; + } + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + struct_ser.serialize_field("label", &self.label)?; + } + if let Some(v) = self.created.as_ref() { + struct_ser.serialize_field("created", v)?; + } + if true { + struct_ser.serialize_field("ibcPortId", &self.ibc_port_id)?; + } + if let Some(v) = self.extension.as_ref() { + struct_ser.serialize_field("extension", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ContractInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + "creator", + "admin", + "label", + "created", + "ibc_port_id", + "ibcPortId", + "extension", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + Creator, + Admin, + Label, + Created, + IbcPortId, + Extension, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "creator" => Ok(GeneratedField::Creator), + "admin" => Ok(GeneratedField::Admin), + "label" => Ok(GeneratedField::Label), + "created" => Ok(GeneratedField::Created), + "ibcPortId" | "ibc_port_id" => Ok(GeneratedField::IbcPortId), + "extension" => Ok(GeneratedField::Extension), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ContractInfo; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ContractInfo") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + let mut creator__ = None; + let mut admin__ = None; + let mut label__ = None; + let mut created__ = None; + let mut ibc_port_id__ = None; + let mut extension__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Creator => { + if creator__.is_some() { + return Err(serde::de::Error::duplicate_field("creator")); + } + creator__ = Some(map_.next_value()?); + } + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = Some(map_.next_value()?); + } + GeneratedField::Created => { + if created__.is_some() { + return Err(serde::de::Error::duplicate_field("created")); + } + created__ = map_.next_value()?; + } + GeneratedField::IbcPortId => { + if ibc_port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("ibcPortId")); + } + ibc_port_id__ = Some(map_.next_value()?); + } + GeneratedField::Extension => { + if extension__.is_some() { + return Err(serde::de::Error::duplicate_field("extension")); + } + extension__ = map_.next_value()?; + } + } + } + Ok(ContractInfo { + code_id: code_id__.unwrap_or_default(), + creator: creator__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + label: label__.unwrap_or_default(), + created: created__, + ibc_port_id: ibc_port_id__.unwrap_or_default(), + extension: extension__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.ContractInfo", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ExecuteContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.ExecuteContractProposal", 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("runAs", &self.run_as)?; + } + if true { + struct_ser.serialize_field("contract", &self.contract)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if true { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ExecuteContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "run_as", + "runAs", + "contract", + "msg", + "funds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + RunAs, + Contract, + Msg, + Funds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "runAs" | "run_as" => Ok(GeneratedField::RunAs), + "contract" => Ok(GeneratedField::Contract), + "msg" => Ok(GeneratedField::Msg), + "funds" => Ok(GeneratedField::Funds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ExecuteContractProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ExecuteContractProposal") + } + + 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 run_as__ = None; + let mut contract__ = None; + let mut msg__ = None; + let mut funds__ = 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::RunAs => { + if run_as__.is_some() { + return Err(serde::de::Error::duplicate_field("runAs")); + } + run_as__ = Some(map_.next_value()?); + } + GeneratedField::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Funds => { + if funds__.is_some() { + return Err(serde::de::Error::duplicate_field("funds")); + } + funds__ = Some(map_.next_value()?); + } + } + } + Ok(ExecuteContractProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + run_as: run_as__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + funds: funds__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.ExecuteContractProposal", 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("cosmwasm.wasm.v1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if true { + struct_ser.serialize_field("codes", &self.codes)?; + } + if true { + struct_ser.serialize_field("contracts", &self.contracts)?; + } + if true { + struct_ser.serialize_field("sequences", &self.sequences)?; + } + if true { + struct_ser.serialize_field("genMsgs", &self.gen_msgs)?; + } + 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", + "codes", + "contracts", + "sequences", + "gen_msgs", + "genMsgs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + Codes, + Contracts, + Sequences, + GenMsgs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "codes" => Ok(GeneratedField::Codes), + "contracts" => Ok(GeneratedField::Contracts), + "sequences" => Ok(GeneratedField::Sequences), + "genMsgs" | "gen_msgs" => Ok(GeneratedField::GenMsgs), + _ => 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 cosmwasm.wasm.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut codes__ = None; + let mut contracts__ = None; + let mut sequences__ = None; + let mut gen_msgs__ = 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::Codes => { + if codes__.is_some() { + return Err(serde::de::Error::duplicate_field("codes")); + } + codes__ = Some(map_.next_value()?); + } + GeneratedField::Contracts => { + if contracts__.is_some() { + return Err(serde::de::Error::duplicate_field("contracts")); + } + contracts__ = Some(map_.next_value()?); + } + GeneratedField::Sequences => { + if sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("sequences")); + } + sequences__ = Some(map_.next_value()?); + } + GeneratedField::GenMsgs => { + if gen_msgs__.is_some() { + return Err(serde::de::Error::duplicate_field("genMsgs")); + } + gen_msgs__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + codes: codes__.unwrap_or_default(), + contracts: contracts__.unwrap_or_default(), + sequences: sequences__.unwrap_or_default(), + gen_msgs: gen_msgs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for genesis_state::GenMsgs { + #[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("cosmwasm.wasm.v1.GenesisState.GenMsgs", len)?; + if let Some(v) = self.sum.as_ref() { + match v { + genesis_state::gen_msgs::Sum::StoreCode(v) => { + struct_ser.serialize_field("storeCode", v)?; + } + genesis_state::gen_msgs::Sum::InstantiateContract(v) => { + struct_ser.serialize_field("instantiateContract", v)?; + } + genesis_state::gen_msgs::Sum::ExecuteContract(v) => { + struct_ser.serialize_field("executeContract", v)?; + } + } + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for genesis_state::GenMsgs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "store_code", + "storeCode", + "instantiate_contract", + "instantiateContract", + "execute_contract", + "executeContract", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + StoreCode, + InstantiateContract, + ExecuteContract, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "storeCode" | "store_code" => Ok(GeneratedField::StoreCode), + "instantiateContract" | "instantiate_contract" => Ok(GeneratedField::InstantiateContract), + "executeContract" | "execute_contract" => Ok(GeneratedField::ExecuteContract), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = genesis_state::GenMsgs; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.GenesisState.GenMsgs") + } + + 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::StoreCode => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("storeCode")); + } + sum__ = map_.next_value::<::core::option::Option<_>>()?.map(genesis_state::gen_msgs::Sum::StoreCode) +; + } + GeneratedField::InstantiateContract => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiateContract")); + } + sum__ = map_.next_value::<::core::option::Option<_>>()?.map(genesis_state::gen_msgs::Sum::InstantiateContract) +; + } + GeneratedField::ExecuteContract => { + if sum__.is_some() { + return Err(serde::de::Error::duplicate_field("executeContract")); + } + sum__ = map_.next_value::<::core::option::Option<_>>()?.map(genesis_state::gen_msgs::Sum::ExecuteContract) +; + } + } + } + Ok(genesis_state::GenMsgs { + sum: sum__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.GenesisState.GenMsgs", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for InstantiateContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.InstantiateContractProposal", 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("runAs", &self.run_as)?; + } + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + struct_ser.serialize_field("label", &self.label)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if true { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for InstantiateContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "run_as", + "runAs", + "admin", + "code_id", + "codeId", + "label", + "msg", + "funds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + RunAs, + Admin, + CodeId, + Label, + Msg, + Funds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "runAs" | "run_as" => Ok(GeneratedField::RunAs), + "admin" => Ok(GeneratedField::Admin), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "label" => Ok(GeneratedField::Label), + "msg" => Ok(GeneratedField::Msg), + "funds" => Ok(GeneratedField::Funds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = InstantiateContractProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.InstantiateContractProposal") + } + + 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 run_as__ = None; + let mut admin__ = None; + let mut code_id__ = None; + let mut label__ = None; + let mut msg__ = None; + let mut funds__ = 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::RunAs => { + if run_as__.is_some() { + return Err(serde::de::Error::duplicate_field("runAs")); + } + run_as__ = Some(map_.next_value()?); + } + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = Some(map_.next_value()?); + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Funds => { + if funds__.is_some() { + return Err(serde::de::Error::duplicate_field("funds")); + } + funds__ = Some(map_.next_value()?); + } + } + } + Ok(InstantiateContractProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + run_as: run_as__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + label: label__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + funds: funds__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.InstantiateContractProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MigrateContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.MigrateContractProposal", 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("contract", &self.contract)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MigrateContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "contract", + "code_id", + "codeId", + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Contract, + CodeId, + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + "contract" => Ok(GeneratedField::Contract), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MigrateContractProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MigrateContractProposal") + } + + 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 contract__ = None; + let mut code_id__ = None; + let mut msg__ = 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::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MigrateContractProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MigrateContractProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Model { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Model", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Model { + #[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 = Model; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Model") + } + + 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(Model { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.Model", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgClearAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgClearAdmin", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgClearAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "contract", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Contract, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "contract" => Ok(GeneratedField::Contract), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgClearAdmin; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgClearAdmin") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut contract__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + } + } + Ok(MsgClearAdmin { + sender: sender__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgClearAdmin", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgClearAdminResponse { + #[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("cosmwasm.wasm.v1.MsgClearAdminResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgClearAdminResponse { + #[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 = MsgClearAdminResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgClearAdminResponse") + } + + 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(MsgClearAdminResponse { + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgClearAdminResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExecuteContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.MsgExecuteContract", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("contract", &self.contract)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if true { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExecuteContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "contract", + "msg", + "funds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Contract, + Msg, + Funds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "contract" => Ok(GeneratedField::Contract), + "msg" => Ok(GeneratedField::Msg), + "funds" => Ok(GeneratedField::Funds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgExecuteContract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgExecuteContract") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut contract__ = None; + let mut msg__ = None; + let mut funds__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Funds => { + if funds__.is_some() { + return Err(serde::de::Error::duplicate_field("funds")); + } + funds__ = Some(map_.next_value()?); + } + } + } + Ok(MsgExecuteContract { + sender: sender__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + funds: funds__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgExecuteContract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgExecuteContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgExecuteContractResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgExecuteContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgExecuteContractResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgExecuteContractResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgExecuteContractResponse { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgExecuteContractResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgIbcCloseChannel { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgIBCCloseChannel", len)?; + if true { + struct_ser.serialize_field("channel", &self.channel)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgIbcCloseChannel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = MsgIbcCloseChannel; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgIBCCloseChannel") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel__ = 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__ = Some(map_.next_value()?); + } + } + } + Ok(MsgIbcCloseChannel { + channel: channel__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgIBCCloseChannel", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgIbcSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.MsgIBCSend", len)?; + if true { + struct_ser.serialize_field("channel", &self.channel)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timeoutHeight", ::alloc::string::ToString::to_string(&self.timeout_height).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("timeoutTimestamp", ::alloc::string::ToString::to_string(&self.timeout_timestamp).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgIbcSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "channel", + "timeout_height", + "timeoutHeight", + "timeout_timestamp", + "timeoutTimestamp", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channel, + TimeoutHeight, + TimeoutTimestamp, + 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 { + "channel" => Ok(GeneratedField::Channel), + "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "timeoutTimestamp" | "timeout_timestamp" => Ok(GeneratedField::TimeoutTimestamp), + "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 = MsgIbcSend; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgIBCSend") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channel__ = None; + let mut timeout_height__ = None; + let mut timeout_timestamp__ = None; + let mut data__ = 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__ = Some(map_.next_value()?); + } + GeneratedField::TimeoutHeight => { + if timeout_height__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutHeight")); + } + timeout_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + 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::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgIbcSend { + channel: channel__.unwrap_or_default(), + timeout_height: timeout_height__.unwrap_or_default(), + timeout_timestamp: timeout_timestamp__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgIBCSend", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgInstantiateContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.MsgInstantiateContract", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + struct_ser.serialize_field("label", &self.label)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if true { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgInstantiateContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "admin", + "code_id", + "codeId", + "label", + "msg", + "funds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Admin, + CodeId, + Label, + Msg, + Funds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "admin" => Ok(GeneratedField::Admin), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "label" => Ok(GeneratedField::Label), + "msg" => Ok(GeneratedField::Msg), + "funds" => Ok(GeneratedField::Funds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgInstantiateContract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContract") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut admin__ = None; + let mut code_id__ = None; + let mut label__ = None; + let mut msg__ = None; + let mut funds__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = Some(map_.next_value()?); + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Funds => { + if funds__.is_some() { + return Err(serde::de::Error::duplicate_field("funds")); + } + funds__ = Some(map_.next_value()?); + } + } + } + Ok(MsgInstantiateContract { + sender: sender__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + label: label__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + funds: funds__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgInstantiateContract2 { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.MsgInstantiateContract2", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("admin", &self.admin)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + struct_ser.serialize_field("label", &self.label)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if true { + struct_ser.serialize_field("funds", &self.funds)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("salt", pbjson::private::base64::encode(&self.salt).as_str())?; + } + if true { + struct_ser.serialize_field("fixMsg", &self.fix_msg)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgInstantiateContract2 { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "admin", + "code_id", + "codeId", + "label", + "msg", + "funds", + "salt", + "fix_msg", + "fixMsg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Admin, + CodeId, + Label, + Msg, + Funds, + Salt, + FixMsg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "admin" => Ok(GeneratedField::Admin), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "label" => Ok(GeneratedField::Label), + "msg" => Ok(GeneratedField::Msg), + "funds" => Ok(GeneratedField::Funds), + "salt" => Ok(GeneratedField::Salt), + "fixMsg" | "fix_msg" => Ok(GeneratedField::FixMsg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgInstantiateContract2; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContract2") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut admin__ = None; + let mut code_id__ = None; + let mut label__ = None; + let mut msg__ = None; + let mut funds__ = None; + let mut salt__ = None; + let mut fix_msg__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = Some(map_.next_value()?); + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Funds => { + if funds__.is_some() { + return Err(serde::de::Error::duplicate_field("funds")); + } + funds__ = Some(map_.next_value()?); + } + GeneratedField::Salt => { + if salt__.is_some() { + return Err(serde::de::Error::duplicate_field("salt")); + } + salt__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::FixMsg => { + if fix_msg__.is_some() { + return Err(serde::de::Error::duplicate_field("fixMsg")); + } + fix_msg__ = Some(map_.next_value()?); + } + } + } + Ok(MsgInstantiateContract2 { + sender: sender__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + label: label__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + funds: funds__.unwrap_or_default(), + salt: salt__.unwrap_or_default(), + fix_msg: fix_msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract2", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgInstantiateContract2Response { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract2Response", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgInstantiateContract2Response { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + 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 { + "address" => Ok(GeneratedField::Address), + "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 = MsgInstantiateContract2Response; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContract2Response") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut data__ = 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::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgInstantiateContract2Response { + address: address__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract2Response", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgInstantiateContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgInstantiateContractResponse", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgInstantiateContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + 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 { + "address" => Ok(GeneratedField::Address), + "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 = MsgInstantiateContractResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContractResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut data__ = 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::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgInstantiateContractResponse { + address: address__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgInstantiateContractResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgMigrateContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgMigrateContract", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("contract", &self.contract)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMigrateContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "contract", + "code_id", + "codeId", + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Contract, + CodeId, + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "contract" => Ok(GeneratedField::Contract), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMigrateContract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgMigrateContract") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut contract__ = None; + let mut code_id__ = None; + let mut msg__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgMigrateContract { + sender: sender__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgMigrateContract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgMigrateContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgMigrateContractResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMigrateContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMigrateContractResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgMigrateContractResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgMigrateContractResponse { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgMigrateContractResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgStoreCode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgStoreCode", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("wasmByteCode", pbjson::private::base64::encode(&self.wasm_byte_code).as_str())?; + } + if let Some(v) = self.instantiate_permission.as_ref() { + struct_ser.serialize_field("instantiatePermission", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgStoreCode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "wasm_byte_code", + "wasmByteCode", + "instantiate_permission", + "instantiatePermission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + WasmByteCode, + InstantiatePermission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), + "instantiatePermission" | "instantiate_permission" => Ok(GeneratedField::InstantiatePermission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgStoreCode; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreCode") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut wasm_byte_code__ = None; + let mut instantiate_permission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::WasmByteCode => { + if wasm_byte_code__.is_some() { + return Err(serde::de::Error::duplicate_field("wasmByteCode")); + } + wasm_byte_code__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::InstantiatePermission => { + if instantiate_permission__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiatePermission")); + } + instantiate_permission__ = map_.next_value()?; + } + } + } + Ok(MsgStoreCode { + sender: sender__.unwrap_or_default(), + wasm_byte_code: wasm_byte_code__.unwrap_or_default(), + instantiate_permission: instantiate_permission__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgStoreCode", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgStoreCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgStoreCodeResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgStoreCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgStoreCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreCodeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + let mut checksum__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgStoreCodeResponse { + code_id: code_id__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgStoreCodeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.MsgUpdateAdmin", len)?; + if true { + struct_ser.serialize_field("sender", &self.sender)?; + } + if true { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + if true { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "new_admin", + "newAdmin", + "contract", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + NewAdmin, + Contract, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "newAdmin" | "new_admin" => Ok(GeneratedField::NewAdmin), + "contract" => Ok(GeneratedField::Contract), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateAdmin; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateAdmin") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut new_admin__ = None; + let mut contract__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sender => { + if sender__.is_some() { + return Err(serde::de::Error::duplicate_field("sender")); + } + sender__ = Some(map_.next_value()?); + } + GeneratedField::NewAdmin => { + if new_admin__.is_some() { + return Err(serde::de::Error::duplicate_field("newAdmin")); + } + new_admin__ = Some(map_.next_value()?); + } + GeneratedField::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateAdmin { + sender: sender__.unwrap_or_default(), + new_admin: new_admin__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgUpdateAdmin", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgUpdateAdminResponse { + #[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("cosmwasm.wasm.v1.MsgUpdateAdminResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgUpdateAdminResponse { + #[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 = MsgUpdateAdminResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateAdminResponse") + } + + 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(MsgUpdateAdminResponse { + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.MsgUpdateAdminResponse", 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("cosmwasm.wasm.v1.Params", len)?; + if let Some(v) = self.code_upload_access.as_ref() { + struct_ser.serialize_field("codeUploadAccess", v)?; + } + if true { + let v = AccessType::try_from(self.instantiate_default_permission) + .map_err(|_| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", self.instantiate_default_permission)))?; + struct_ser.serialize_field("instantiateDefaultPermission", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_upload_access", + "codeUploadAccess", + "instantiate_default_permission", + "instantiateDefaultPermission", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeUploadAccess, + InstantiateDefaultPermission, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeUploadAccess" | "code_upload_access" => Ok(GeneratedField::CodeUploadAccess), + "instantiateDefaultPermission" | "instantiate_default_permission" => Ok(GeneratedField::InstantiateDefaultPermission), + _ => 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 cosmwasm.wasm.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_upload_access__ = None; + let mut instantiate_default_permission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeUploadAccess => { + if code_upload_access__.is_some() { + return Err(serde::de::Error::duplicate_field("codeUploadAccess")); + } + code_upload_access__ = map_.next_value()?; + } + GeneratedField::InstantiateDefaultPermission => { + if instantiate_default_permission__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiateDefaultPermission")); + } + instantiate_default_permission__ = Some(map_.next_value::()? as i32); + } + } + } + Ok(Params { + code_upload_access: code_upload_access__, + instantiate_default_permission: instantiate_default_permission__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.Params", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for PinCodesProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.PinCodesProposal", 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("codeIds", &self.code_ids.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for PinCodesProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "code_ids", + "codeIds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + CodeIds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "codeIds" | "code_ids" => Ok(GeneratedField::CodeIds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = PinCodesProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.PinCodesProposal") + } + + 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 code_ids__ = 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::CodeIds => { + if code_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("codeIds")); + } + code_ids__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(PinCodesProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + code_ids: code_ids__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.PinCodesProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllContractStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryAllContractStateRequest", 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 QueryAllContractStateRequest { + #[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 = QueryAllContractStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryAllContractStateRequest") + } + + 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(QueryAllContractStateRequest { + address: address__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryAllContractStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryAllContractStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryAllContractStateResponse", len)?; + if true { + struct_ser.serialize_field("models", &self.models)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryAllContractStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "models", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Models, + 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 { + "models" => Ok(GeneratedField::Models), + "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 = QueryAllContractStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryAllContractStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut models__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Models => { + if models__.is_some() { + return Err(serde::de::Error::duplicate_field("models")); + } + models__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllContractStateResponse { + models: models__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryAllContractStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryCodeRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_id).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCodeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryCodeRequest { + code_id: code_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryCodeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryCodeResponse", len)?; + if let Some(v) = self.code_info.as_ref() { + struct_ser.serialize_field("codeInfo", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_info", + "codeInfo", + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeInfo, + 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 { + "codeInfo" | "code_info" => Ok(GeneratedField::CodeInfo), + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_info__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeInfo => { + if code_info__.is_some() { + return Err(serde::de::Error::duplicate_field("codeInfo")); + } + code_info__ = 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) + ; + } + } + } + Ok(QueryCodeResponse { + code_info: code_info__, + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryCodeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryCodesRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodesRequest { + #[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 = QueryCodesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodesRequest") + } + + 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(QueryCodesRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryCodesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryCodesResponse", len)?; + if true { + struct_ser.serialize_field("codeInfos", &self.code_infos)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_infos", + "codeInfos", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeInfos, + 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 { + "codeInfos" | "code_infos" => Ok(GeneratedField::CodeInfos), + "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 = QueryCodesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_infos__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeInfos => { + if code_infos__.is_some() { + return Err(serde::de::Error::duplicate_field("codeInfos")); + } + code_infos__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryCodesResponse { + code_infos: code_infos__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryCodesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryContractHistoryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractHistoryRequest", 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 QueryContractHistoryRequest { + #[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 = QueryContractHistoryRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractHistoryRequest") + } + + 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(QueryContractHistoryRequest { + address: address__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryContractHistoryRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryContractHistoryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractHistoryResponse", len)?; + if true { + struct_ser.serialize_field("entries", &self.entries)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryContractHistoryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "entries", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Entries, + 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 { + "entries" => Ok(GeneratedField::Entries), + "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 = QueryContractHistoryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractHistoryResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut entries__ = None; + let mut pagination__ = 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::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryContractHistoryResponse { + entries: entries__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryContractHistoryResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryContractInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractInfoRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryContractInfoRequest { + #[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 = QueryContractInfoRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractInfoRequest") + } + + 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(QueryContractInfoRequest { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryContractInfoRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryContractInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractInfoResponse", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.contract_info.as_ref() { + struct_ser.serialize_field("contractInfo", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryContractInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "contract_info", + "contractInfo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + ContractInfo, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "contractInfo" | "contract_info" => Ok(GeneratedField::ContractInfo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryContractInfoResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractInfoResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut contract_info__ = 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::ContractInfo => { + if contract_info__.is_some() { + return Err(serde::de::Error::duplicate_field("contractInfo")); + } + contract_info__ = map_.next_value()?; + } + } + } + Ok(QueryContractInfoResponse { + address: address__.unwrap_or_default(), + contract_info: contract_info__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryContractInfoResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryContractsByCodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractsByCodeRequest", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ::alloc::string::ToString::to_string(&self.code_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 QueryContractsByCodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_id", + "codeId", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + 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 { + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "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 = QueryContractsByCodeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractsByCodeRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeId => { + if code_id__.is_some() { + return Err(serde::de::Error::duplicate_field("codeId")); + } + code_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(QueryContractsByCodeRequest { + code_id: code_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryContractsByCodeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryContractsByCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractsByCodeResponse", len)?; + if true { + struct_ser.serialize_field("contracts", &self.contracts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryContractsByCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "contracts", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Contracts, + 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 { + "contracts" => Ok(GeneratedField::Contracts), + "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 = QueryContractsByCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractsByCodeResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut contracts__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Contracts => { + if contracts__.is_some() { + return Err(serde::de::Error::duplicate_field("contracts")); + } + contracts__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryContractsByCodeResponse { + contracts: contracts__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryContractsByCodeResponse", 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("cosmwasm.wasm.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 cosmwasm.wasm.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("cosmwasm.wasm.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("cosmwasm.wasm.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 cosmwasm.wasm.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("cosmwasm.wasm.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPinnedCodesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryPinnedCodesRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPinnedCodesRequest { + #[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 = QueryPinnedCodesRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryPinnedCodesRequest") + } + + 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(QueryPinnedCodesRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryPinnedCodesRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryPinnedCodesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryPinnedCodesResponse", len)?; + if true { + struct_ser.serialize_field("codeIds", &self.code_ids.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryPinnedCodesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_ids", + "codeIds", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeIds, + 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 { + "codeIds" | "code_ids" => Ok(GeneratedField::CodeIds), + "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 = QueryPinnedCodesResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryPinnedCodesResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_ids__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeIds => { + if code_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("codeIds")); + } + code_ids__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryPinnedCodesResponse { + code_ids: code_ids__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryPinnedCodesResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryRawContractStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryRawContractStateRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("queryData", pbjson::private::base64::encode(&self.query_data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryRawContractStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "query_data", + "queryData", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + QueryData, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "queryData" | "query_data" => Ok(GeneratedField::QueryData), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryRawContractStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryRawContractStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut query_data__ = 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::QueryData => { + if query_data__.is_some() { + return Err(serde::de::Error::duplicate_field("queryData")); + } + query_data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryRawContractStateRequest { + address: address__.unwrap_or_default(), + query_data: query_data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryRawContractStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryRawContractStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QueryRawContractStateResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryRawContractStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryRawContractStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryRawContractStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryRawContractStateResponse { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QueryRawContractStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySmartContractStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QuerySmartContractStateRequest", len)?; + if true { + struct_ser.serialize_field("address", &self.address)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("queryData", pbjson::private::base64::encode(&self.query_data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySmartContractStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "address", + "query_data", + "queryData", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + QueryData, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "queryData" | "query_data" => Ok(GeneratedField::QueryData), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QuerySmartContractStateRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QuerySmartContractStateRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut query_data__ = 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::QueryData => { + if query_data__.is_some() { + return Err(serde::de::Error::duplicate_field("queryData")); + } + query_data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QuerySmartContractStateRequest { + address: address__.unwrap_or_default(), + query_data: query_data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QuerySmartContractStateRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QuerySmartContractStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.QuerySmartContractStateResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QuerySmartContractStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QuerySmartContractStateResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QuerySmartContractStateResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QuerySmartContractStateResponse { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.QuerySmartContractStateResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Sequence { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Sequence", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("idKey", pbjson::private::base64::encode(&self.id_key).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", ::alloc::string::ToString::to_string(&self.value).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Sequence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "id_key", + "idKey", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IdKey, + 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 { + "idKey" | "id_key" => Ok(GeneratedField::IdKey), + "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 = Sequence; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Sequence") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut id_key__ = None; + let mut value__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::IdKey => { + if id_key__.is_some() { + return Err(serde::de::Error::duplicate_field("idKey")); + } + id_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::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(Sequence { + id_key: id_key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.Sequence", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StoreCodeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.StoreCodeProposal", 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("runAs", &self.run_as)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("wasmByteCode", pbjson::private::base64::encode(&self.wasm_byte_code).as_str())?; + } + if let Some(v) = self.instantiate_permission.as_ref() { + struct_ser.serialize_field("instantiatePermission", v)?; + } + if true { + struct_ser.serialize_field("unpinCode", &self.unpin_code)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StoreCodeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "run_as", + "runAs", + "wasm_byte_code", + "wasmByteCode", + "instantiate_permission", + "instantiatePermission", + "unpin_code", + "unpinCode", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + RunAs, + WasmByteCode, + InstantiatePermission, + UnpinCode, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "runAs" | "run_as" => Ok(GeneratedField::RunAs), + "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), + "instantiatePermission" | "instantiate_permission" => Ok(GeneratedField::InstantiatePermission), + "unpinCode" | "unpin_code" => Ok(GeneratedField::UnpinCode), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StoreCodeProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.StoreCodeProposal") + } + + 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 run_as__ = None; + let mut wasm_byte_code__ = None; + let mut instantiate_permission__ = None; + let mut unpin_code__ = 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::RunAs => { + if run_as__.is_some() { + return Err(serde::de::Error::duplicate_field("runAs")); + } + run_as__ = Some(map_.next_value()?); + } + GeneratedField::WasmByteCode => { + if wasm_byte_code__.is_some() { + return Err(serde::de::Error::duplicate_field("wasmByteCode")); + } + wasm_byte_code__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::InstantiatePermission => { + if instantiate_permission__.is_some() { + return Err(serde::de::Error::duplicate_field("instantiatePermission")); + } + instantiate_permission__ = map_.next_value()?; + } + GeneratedField::UnpinCode => { + if unpin_code__.is_some() { + return Err(serde::de::Error::duplicate_field("unpinCode")); + } + unpin_code__ = Some(map_.next_value()?); + } + } + } + Ok(StoreCodeProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + run_as: run_as__.unwrap_or_default(), + wasm_byte_code: wasm_byte_code__.unwrap_or_default(), + instantiate_permission: instantiate_permission__, + unpin_code: unpin_code__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.StoreCodeProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for SudoContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.SudoContractProposal", 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("contract", &self.contract)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for SudoContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "contract", + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Contract, + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "title" => Ok(GeneratedField::Title), + "description" => Ok(GeneratedField::Description), + "contract" => Ok(GeneratedField::Contract), + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SudoContractProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.SudoContractProposal") + } + + 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 contract__ = None; + let mut msg__ = 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::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(SudoContractProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.SudoContractProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UnpinCodesProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.UnpinCodesProposal", 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("codeIds", &self.code_ids.iter().map(::alloc::string::ToString::to_string).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UnpinCodesProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "code_ids", + "codeIds", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + CodeIds, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "codeIds" | "code_ids" => Ok(GeneratedField::CodeIds), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UnpinCodesProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.UnpinCodesProposal") + } + + 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 code_ids__ = 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::CodeIds => { + if code_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("codeIds")); + } + code_ids__ = + Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::NumberDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(UnpinCodesProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + code_ids: code_ids__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.UnpinCodesProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UpdateAdminProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + 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("cosmwasm.wasm.v1.UpdateAdminProposal", 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("newAdmin", &self.new_admin)?; + } + if true { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UpdateAdminProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "new_admin", + "newAdmin", + "contract", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + NewAdmin, + Contract, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "newAdmin" | "new_admin" => Ok(GeneratedField::NewAdmin), + "contract" => Ok(GeneratedField::Contract), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UpdateAdminProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.UpdateAdminProposal") + } + + 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 new_admin__ = None; + let mut contract__ = 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::NewAdmin => { + if new_admin__.is_some() { + return Err(serde::de::Error::duplicate_field("newAdmin")); + } + new_admin__ = Some(map_.next_value()?); + } + GeneratedField::Contract => { + if contract__.is_some() { + return Err(serde::de::Error::duplicate_field("contract")); + } + contract__ = Some(map_.next_value()?); + } + } + } + Ok(UpdateAdminProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + new_admin: new_admin__.unwrap_or_default(), + contract: contract__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.UpdateAdminProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for UpdateInstantiateConfigProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + 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("cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", 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("accessConfigUpdates", &self.access_config_updates)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for UpdateInstantiateConfigProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "title", + "description", + "access_config_updates", + "accessConfigUpdates", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + AccessConfigUpdates, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(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), + "accessConfigUpdates" | "access_config_updates" => Ok(GeneratedField::AccessConfigUpdates), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UpdateInstantiateConfigProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.UpdateInstantiateConfigProposal") + } + + 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 access_config_updates__ = 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::AccessConfigUpdates => { + if access_config_updates__.is_some() { + return Err(serde::de::Error::duplicate_field("accessConfigUpdates")); + } + access_config_updates__ = Some(map_.next_value()?); + } + } + } + Ok(UpdateInstantiateConfigProposal { + title: title__.unwrap_or_default(), + description: description__.unwrap_or_default(), + access_config_updates: access_config_updates__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/type_names.rs b/cosmos-sdk-proto/src/type_names.rs index c00ed3b8..912c1004 100644 --- a/cosmos-sdk-proto/src/type_names.rs +++ b/cosmos-sdk-proto/src/type_names.rs @@ -3,7 +3,7 @@ // TODO(tarcieri): generate these automatically using `prost-build` // See: https://github.com/tokio-rs/prost/issues/926 -use crate::{cosmos, ibc, traits::Name}; +use crate::{cosmos, traits::Name}; macro_rules! impl_name { ($type:ty, $package:expr, $name:expr) => { @@ -18,49 +18,6 @@ macro_rules! impl_name { }; } -impl_name!( - ibc::core::client::v1::ClientUpdateProposal, - "ibc.core.client.v1", - "ClientUpdateProposal" -); -impl_name!( - ibc::core::client::v1::MsgUpdateClient, - "ibc.core.client.v1", - "MsgUpdateClient" -); - -impl_name!( - ibc::core::channel::v1::MsgChannelOpenConfirm, - "ibc.core.channel.v1", - "MsgChannelOpenConfirm" -); -impl_name!( - ibc::core::channel::v1::MsgAcknowledgement, - "ibc.core.channel.v1", - "MsgAcknowledgement" -); -impl_name!( - ibc::core::channel::v1::MsgChannelOpenAck, - "ibc.core.channel.v1", - "MsgChannelOpenAck" -); -impl_name!( - ibc::core::channel::v1::MsgTimeout, - "ibc.core.channel.v1", - "MsgTimeout" -); -impl_name!( - ibc::core::channel::v1::MsgRecvPacket, - "ibc.core.channel.v1", - "MsgRecvPacket" -); - -impl_name!( - ibc::applications::transfer::v1::MsgTransfer, - "ibc.applications.transfer.v1", - "MsgTransfer" -); - impl_name!( cosmos::upgrade::v1beta1::SoftwareUpgradeProposal, "cosmos.upgrade.v1beta1", diff --git a/ibc-go b/ibc-go deleted file mode 160000 index 46e02064..00000000 --- a/ibc-go +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 46e020640e66f9043c14c53a4d215a5b457d6703 diff --git a/proto-build/Cargo.toml b/proto-build/Cargo.toml index 4f97ead2..68f90e5e 100644 --- a/proto-build/Cargo.toml +++ b/proto-build/Cargo.toml @@ -12,3 +12,4 @@ tonic = "0.10" tonic-build = "0.10" regex = "1" walkdir = "2" +informalsystems-pbjson-build = "0.7.0" diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index bfae34d2..c7050174 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -1,4 +1,4 @@ -//! Build CosmosSDK/Tendermint/IBC proto files. This build script clones the CosmosSDK version +//! Build CosmosSDK/Tendermint proto files. This build script clones the CosmosSDK version //! specified in the COSMOS_SDK_REV constant and then uses that to build the required //! proto files for further compilation. This is based on the proto-compiler code //! in github.com/informalsystems/ibc-rs @@ -20,10 +20,7 @@ use walkdir::WalkDir; static QUIET: AtomicBool = AtomicBool::new(false); /// The Cosmos SDK commit or tag to be cloned and used to build the proto files -const COSMOS_SDK_REV: &str = "v0.46.15"; - -/// The Cosmos ibc-go commit or tag to be cloned and used to build the proto files -const IBC_REV: &str = "v3.0.0"; +const COSMOS_SDK_REV: &str = "v0.47.0"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.29.2"; @@ -35,8 +32,6 @@ const WASMD_REV: &str = "v0.29.2"; const COSMOS_SDK_PROTO_DIR: &str = "../cosmos-sdk-proto/src/prost/"; /// Directory where the cosmos-sdk submodule is located const COSMOS_SDK_DIR: &str = "../cosmos-sdk-go"; -/// Directory where the cosmos/ibc-go submodule is located -const IBC_DIR: &str = "../ibc-go"; /// Directory where the submodule is located const WASMD_DIR: &str = "../wasmd"; /// A temporary directory for proto building @@ -74,23 +69,18 @@ fn main() { } let temp_sdk_dir = tmp_build_dir.join("cosmos-sdk"); - let temp_ibc_dir = tmp_build_dir.join("ibc-go"); let temp_wasmd_dir = tmp_build_dir.join("wasmd"); fs::create_dir_all(&temp_sdk_dir).unwrap(); - fs::create_dir_all(&temp_ibc_dir).unwrap(); fs::create_dir_all(&temp_wasmd_dir).unwrap(); update_submodules(); output_sdk_version(&temp_sdk_dir); - output_ibc_version(&temp_ibc_dir); output_wasmd_version(&temp_wasmd_dir); compile_sdk_protos_and_services(&temp_sdk_dir); - compile_ibc_protos_and_services(&temp_ibc_dir); compile_wasmd_proto_and_services(&temp_wasmd_dir); copy_generated_files(&temp_sdk_dir, &proto_dir.join("cosmos-sdk")); - copy_generated_files(&temp_ibc_dir, &proto_dir.join("ibc-go")); copy_generated_files(&temp_wasmd_dir, &proto_dir.join("wasmd")); apply_patches(&proto_dir); @@ -100,8 +90,8 @@ fn main() { if is_github() { println!( - "Rebuild protos with proto-build (cosmos-sdk rev: {} ibc-go rev: {} wasmd rev: {}))", - COSMOS_SDK_REV, IBC_REV, WASMD_REV + "Rebuild protos with proto-build (cosmos-sdk rev: {}, wasmd rev: {}))", + COSMOS_SDK_REV, WASMD_REV ); } } @@ -160,6 +150,20 @@ fn run_buf(config: &str, proto_path: impl AsRef, out_dir: impl AsRef &proto_path.as_ref().display().to_string(), ], ); + + run_cmd( + "buf", + [ + "build", + "-o", + &out_dir + .as_ref() + .join("proto_descriptor.binpb") + .display() + .to_string(), + &proto_path.as_ref().display().to_string(), + ], + ); } fn run_git(args: impl IntoIterator>) { @@ -177,6 +181,12 @@ fn run_rustfmt(dir: &Path) { .into_iter() .filter_map(|e| e.ok()) .filter(|e| e.file_type().is_file() && e.path().extension() == Some(OsStr::new("rs"))) + .filter(|e| { + !e.path() + .file_name() + .map(|name| name.to_string_lossy()) + .map_or(true, |name| name.ends_with(".serde.rs")) + }) .map(|e| e.into_path()) .map(Into::into), ); @@ -190,11 +200,6 @@ fn update_submodules() { run_git(["-C", COSMOS_SDK_DIR, "fetch"]); run_git(["-C", COSMOS_SDK_DIR, "reset", "--hard", COSMOS_SDK_REV]); - info!("Updating cosmos/ibc-go submodule..."); - run_git(["submodule", "update", "--init"]); - run_git(["-C", IBC_DIR, "fetch"]); - run_git(["-C", IBC_DIR, "reset", "--hard", IBC_REV]); - info!("Updating wasmd submodule..."); run_git(["submodule", "update", "--init"]); run_git(["-C", WASMD_DIR, "fetch"]); @@ -206,11 +211,6 @@ fn output_sdk_version(out_dir: &Path) { fs::write(path, COSMOS_SDK_REV).unwrap(); } -fn output_ibc_version(out_dir: &Path) { - let path = out_dir.join("IBC_COMMIT"); - fs::write(path, IBC_REV).unwrap(); -} - fn output_wasmd_version(out_dir: &Path) { let path = out_dir.join("WASMD_COMMIT"); fs::write(path, WASMD_REV).unwrap(); @@ -227,6 +227,8 @@ fn compile_sdk_protos_and_services(out_dir: &Path) { let proto_path = Path::new(COSMOS_SDK_DIR).join("proto"); run_buf("buf.sdk.gen.yaml", proto_path, out_dir); info!("=> Done!"); + + generate_pbjson_impls(&[".cosmos", ".google"], out_dir); } fn compile_wasmd_proto_and_services(out_dir: &Path) { @@ -242,57 +244,24 @@ fn compile_wasmd_proto_and_services(out_dir: &Path) { info!("Compiling wasmd proto clients for GRPC services!"); run_buf("buf.wasmd.gen.yaml", proto_path, out_dir); info!("=> Done!"); -} -fn compile_ibc_protos_and_services(out_dir: &Path) { - info!( - "Compiling .proto files to Rust into '{}'...", - out_dir.display() - ); - - let root = env!("CARGO_MANIFEST_DIR"); - let ibc_dir = Path::new(IBC_DIR); - - let proto_includes_paths = [ - format!("{}/../proto", root), - format!("{}/proto", ibc_dir.display()), - format!("{}/third_party/proto", ibc_dir.display()), - ]; + generate_pbjson_impls(&[".cosmwasm", ".google"], out_dir); +} - let proto_paths = [ - format!("{}/../proto/definitions/mock", root), - format!( - "{}/proto/ibc/applications/interchain_accounts", - ibc_dir.display() - ), - format!("{}/proto/ibc/applications/transfer", ibc_dir.display()), - format!("{}/proto/ibc/core/channel", ibc_dir.display()), - format!("{}/proto/ibc/core/client", ibc_dir.display()), - format!("{}/proto/ibc/core/commitment", ibc_dir.display()), - format!("{}/proto/ibc/core/connection", ibc_dir.display()), - format!("{}/proto/ibc/core/port", ibc_dir.display()), - format!("{}/proto/ibc/core/types", ibc_dir.display()), - format!("{}/proto/ibc/lightclients/localhost", ibc_dir.display()), - format!("{}/proto/ibc/lightclients/solomachine", ibc_dir.display()), - format!("{}/proto/ibc/lightclients/tendermint", ibc_dir.display()), - ]; - // List available proto files - let mut protos: Vec = vec![]; - collect_protos(&proto_paths, &mut protos); +fn generate_pbjson_impls(prefixes: &[&str], out_dir: &Path) { + println!("[info ] Generating pbjson Serialize, Deserialize impls..."); - let includes: Vec = proto_includes_paths.iter().map(PathBuf::from).collect(); + let descriptor_set_path = out_dir.join("proto_descriptor.binpb"); + let descriptor_set = std::fs::read(&descriptor_set_path).unwrap(); + std::fs::remove_file(descriptor_set_path).unwrap(); - // Compile all of the proto files, along with the grpc service clients - info!("Compiling proto definitions and clients for GRPC services!"); - tonic_build::configure() - .build_client(true) - .build_server(false) + pbjson_build::Builder::new() + .register_descriptors(&descriptor_set) + .unwrap() .out_dir(out_dir) - .extern_path(".tendermint", "::tendermint_proto") - .compile(&protos, &includes) + .emit_fields() + .build(prefixes) .unwrap(); - - info!("=> Done!"); } /// collect_protos walks every path in `proto_paths` and recursively locates all .proto @@ -350,6 +319,8 @@ fn copy_generated_files(from_dir: &Path, to_dir: &Path) { fn copy_and_patch(src: impl AsRef, dest: impl AsRef) -> io::Result<()> { /// Regex substitutions to apply to the prost-generated output const REPLACEMENTS: &[(&str, &str)] = &[ + // Use `prost-wkt-types` proto definitions + ("prost_types::", "prost_wkt_types::"), // Use `tendermint-proto` proto definitions ("(super::)+tendermint", "tendermint_proto"), // Feature-gate gRPC client modules @@ -401,18 +372,34 @@ fn patch_file(path: impl AsRef, pattern: &Regex, replacement: &str) -> io: /// Fix clashing type names in prost-generated code. See cosmos/cosmos-rust#154. fn apply_patches(proto_dir: &Path) { - for (pattern, replacement) in [ - ("enum Validators", "enum Policy"), + const PATCHES: &[(&str, &[(&str, &str)])] = &[ + ( + "cosmos-sdk/cosmos.staking.v1beta1.rs", + &[ + ("enum Validators", "enum Policy"), + ( + "stake_authorization::Validators", + "stake_authorization::Policy", + ), + ], + ), ( - "stake_authorization::Validators", - "stake_authorization::Policy", + "cosmos-sdk/cosmos.staking.v1beta1.serde.rs", + &[( + "stake_authorization::Validators::", + "stake_authorization::Policy::", + )], ), - ] { - patch_file( - &proto_dir.join("cosmos-sdk/cosmos.staking.v1beta1.rs"), - &Regex::new(pattern).unwrap(), - replacement, - ) - .expect("error patching cosmos.staking.v1beta1.rs"); + ]; + + for (file, patches) in PATCHES { + for (pattern, replacement) in patches.iter() { + patch_file( + &proto_dir.join(file), + &Regex::new(pattern).unwrap(), + replacement, + ) + .unwrap_or_else(|e| panic!("error patching {}: {}", file, e)); + } } }