diff --git a/.gitmodules b/.gitmodules index 0fe39efc..b5f979d4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,12 @@ [submodule "ibc-go"] path = ibc-go url = https://github.com/cosmos/ibc-go +[submodule "xion"] + path = xion + url = https://github.com/burnt-labs/xion +[submodule "tokenfactory"] + path = tokenfactory + url = https://github.com/strangelove-ventures/tokenfactory.git +[submodule "abstract-account"] + path = abstract-account + url = https://github.com/burnt-labs/abstract-account.git diff --git a/Cargo.lock b/Cargo.lock index bcf3a095..eb8a86da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,6 +65,12 @@ dependencies = [ "syn", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -73,18 +79,17 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.6.20" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "http", - "http-body", - "hyper", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "itoa", "matchit", "memchr", @@ -93,7 +98,7 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper", + "sync_wrapper 1.0.1", "tower", "tower-layer", "tower-service", @@ -101,17 +106,20 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" dependencies = [ "async-trait", "bytes", "futures-util", - "http", - "http-body", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", ] @@ -143,6 +151,12 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -264,17 +278,18 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cosmos-sdk-proto" -version = "0.22.0-pre" +version = "0.24.0-pre" dependencies = [ + "informalsystems-pbjson", "prost", - "prost-types", + "serde", "tendermint-proto", "tonic", ] [[package]] name = "cosmrs" -version = "0.17.0-pre" +version = "0.19.0-pre" dependencies = [ "bip32", "cosmos-sdk-proto", @@ -459,7 +474,7 @@ checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ "errno-dragonfly", "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -655,7 +670,26 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.9", + "indexmap 2.0.2", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", "indexmap 2.0.2", "slab", "tokio", @@ -709,19 +743,21 @@ dependencies = [ ] [[package]] -name = "home" -version = "0.5.5" +name = "http" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "windows-sys", + "bytes", + "fnv", + "itoa", ] [[package]] name = "http" -version = "0.2.9" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -735,7 +771,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http", + "http 0.2.9", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -761,9 +820,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.24", + "http 0.2.9", + "http-body 0.4.5", "httparse", "httpdate", "itoa", @@ -775,6 +834,27 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.1" @@ -782,8 +862,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ "futures-util", - "http", - "hyper", + "http 0.2.9", + "hyper 0.14.27", "rustls", "tokio", "tokio-rustls", @@ -791,14 +871,35 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +dependencies = [ + "hyper 1.4.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ - "hyper", + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", + "socket2 0.5.7", "tokio", - "tokio-io-timeout", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -837,6 +938,16 @@ 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 0.21.4", + "serde", +] + [[package]] name = "ipnet" version = "2.8.0" @@ -881,9 +992,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "linux-raw-sys" @@ -926,13 +1037,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1096,18 +1207,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" dependencies = [ "bytes", "prost-derive", @@ -1115,9 +1226,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +checksum = "5bb182580f71dd070f88d01ce3de9f4da5021db7115d2e1c3605a754153b77c1" dependencies = [ "bytes", "heck", @@ -1132,14 +1243,13 @@ dependencies = [ "regex", "syn", "tempfile", - "which", ] [[package]] name = "prost-derive" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", "itertools", @@ -1150,9 +1260,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" dependencies = [ "prost", ] @@ -1171,9 +1281,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1252,15 +1362,15 @@ version = "0.11.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78fdbab6a7e1d7b13cc8ff10197f47986b41c639300cc3c8158cac7847c9bbef" dependencies = [ - "base64", + "base64 0.21.4", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", + "h2 0.3.24", + "http 0.2.9", + "http-body 0.4.5", + "hyper 0.14.27", "hyper-rustls", "ipnet", "js-sys", @@ -1336,7 +1446,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1369,7 +1479,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64", + "base64 0.21.4", ] [[package]] @@ -1409,7 +1519,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1467,9 +1577,9 @@ checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] @@ -1485,9 +1595,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", @@ -1580,6 +1690,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + [[package]] name = "socket2" version = "0.4.9" @@ -1592,12 +1708,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1639,9 +1755,9 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "syn" -version = "2.0.37" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -1654,6 +1770,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "system-configuration" version = "0.5.1" @@ -1685,14 +1807,14 @@ dependencies = [ "fastrand", "redox_syscall", "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "tendermint" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954496fbc9716eb4446cdd6d00c071a3e2f22578d62aa03b40c7e5b4fda3ed42" +checksum = "2f3afea7809ffaaf1e5d9c3c9997cb3a834df7e94fbfab2fad2bc4577f1cde41" dependencies = [ "bytes", "digest 0.10.7", @@ -1704,7 +1826,6 @@ dependencies = [ "num-traits", "once_cell", "prost", - "prost-types", "ripemd", "serde", "serde_bytes", @@ -1721,9 +1842,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84b11b57d20ee4492a1452faff85f5c520adc36ca9fe5e701066935255bb89f" +checksum = "d8add7b85b0282e5901521f78fe441956ac1e2752452f4e1f2c0ce7e1f10d485" dependencies = [ "flex-error", "serde", @@ -1735,14 +1856,13 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc87024548c7f3da479885201e3da20ef29e85a3b13d04606b380ac4c7120d87" +checksum = "bf3abf34ecf33125621519e9952688e7a59a98232d51538037ba21fbe526a802" dependencies = [ "bytes", "flex-error", "prost", - "prost-types", "serde", "serde_bytes", "subtle-encoding", @@ -1751,9 +1871,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.37.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfdc2281e271277fda184d96d874a6fe59f569b130b634289257baacfc95aa85" +checksum = "9693f42544bf3b41be3cbbfa418650c86e137fb8f5a57981659a84b677721ecf" dependencies = [ "async-trait", "bytes", @@ -1846,9 +1966,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -1856,26 +1976,16 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.4", + "socket2 0.5.7", "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -1953,23 +2063,26 @@ dependencies = [ [[package]] name = "tonic" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" dependencies = [ "async-stream", "async-trait", "axum", - "base64", + "base64 0.22.1", "bytes", - "h2", - "http", - "http-body", - "hyper", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", "prost", + "socket2 0.5.7", "tokio", "tokio-stream", "tower", @@ -1980,9 +2093,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +checksum = "568392c5a2bd0020723e3f387891176aabafe36fd9fcd074ad309dfa0c8eb964" dependencies = [ "prettyplease", "proc-macro2", @@ -2218,18 +2331,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2267,7 +2368,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -2276,13 +2386,29 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -2291,42 +2417,90 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winnow" version = "0.6.5" @@ -2343,7 +2517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] diff --git a/abstract-account b/abstract-account new file mode 160000 index 00000000..2c933a7b --- /dev/null +++ b/abstract-account @@ -0,0 +1 @@ +Subproject commit 2c933a7b2a8dacc0ae5bf4344159a7d4ab080135 diff --git a/cosmos-sdk-proto/CHANGELOG.md b/cosmos-sdk-proto/CHANGELOG.md index 4e6f84bf..0b48588d 100644 --- a/cosmos-sdk-proto/CHANGELOG.md +++ b/cosmos-sdk-proto/CHANGELOG.md @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.23.0 (2024-08-02) +### Added +- Support for `no_std` ([#478]) + +### Changed +- Bump `tendermint-proto` dependency to v0.38 ([#476]) + +[#476]: https://github.com/cosmos/cosmos-rust/pull/476 +[#478]: https://github.com/cosmos/cosmos-rust/pull/478 + +## 0.22.0 (2024-06-27) +### Changed +- Bump `tendermint-proto` dependency to v0.37 ([#469]) + +[#469]: https://github.com/cosmos/cosmos-rust/pull/469 + ## 0.21.1 (2024-03-15) ### Removed - Deprecated `MessageExt` methods: missed from v0.21.0, technically a breaking diff --git a/cosmos-sdk-proto/Cargo.toml b/cosmos-sdk-proto/Cargo.toml index 621746f2..7ba46149 100644 --- a/cosmos-sdk-proto/Cargo.toml +++ b/cosmos-sdk-proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmos-sdk-proto" -version = "0.22.0-pre" +version = "0.24.0-pre" authors = [ "Justin Kilpatrick ", "Greg Szabo ", @@ -16,18 +16,23 @@ edition = "2021" rust-version = "1.72" [dependencies] -prost = "0.12.3" -prost-types = "0.12" -tendermint-proto = "0.37" +prost = { version = "0.13", default-features = false } +tendermint-proto = "0.39.1" # Optional dependencies -tonic = { version = "0.11", optional = true, default-features = false, features = ["codegen", "prost"] } +tonic = { version = "0.12", optional = true, default-features = false, features = ["codegen", "prost"] } +serde = { version = "1.0.203", optional = true, default-features = false, features = ["alloc"] } +pbjson = { package = "informalsystems-pbjson", optional = true, version = "0.7" } [features] default = ["grpc-transport"] -grpc = ["tonic"] +std = ["prost/std", "tendermint-proto/std"] +grpc = ["std", "tonic"] grpc-transport = ["grpc", "tonic/transport"] cosmwasm = [] +serde = ["dep:serde", "tendermint-proto/std", "pbjson"] +xion = [] +tokenfactory = [] [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..d1ecd32a 100644 --- a/cosmos-sdk-proto/src/lib.rs +++ b/cosmos-sdk-proto/src/lib.rs @@ -10,13 +10,16 @@ )] #![forbid(unsafe_code)] #![warn(trivial_casts, trivial_numeric_casts, unused_import_braces)] +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate alloc; pub mod traits; mod type_names; pub use prost; -pub use prost_types::{Any, Timestamp}; pub use tendermint_proto as tendermint; +pub use tendermint_proto::google::protobuf::{Any, Timestamp}; /// 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"); @@ -340,3 +343,31 @@ pub mod ibc { pub mod ics23 { include!("prost/ibc-go/ics23.rs"); } + +pub mod abstract_account { + pub mod v1 { + include!("prost/abstract-account/abstractaccount.v1.rs"); + } +} + +#[cfg(feature = "xion")] +pub mod xion { + /// Messages and services handling Xion. + pub mod v1 { + include!("prost/xion/xion.v1.rs"); + pub mod jwk { + include!("prost/xion/xion.jwk.v1.rs"); + } + } +} + +#[cfg(feature = "tokenfactory")] +pub mod osmosis { + pub mod tokenfactory { + /// Messages and services handling Tokenfactory. + pub mod v1beta1 { + include!("prost/tokenfactory/osmosis.tokenfactory.v1beta1.rs"); + } + } +} + diff --git a/cosmos-sdk-proto/src/prost/abstract-account/ABSTRACT_ACCOUNT_COMMIT b/cosmos-sdk-proto/src/prost/abstract-account/ABSTRACT_ACCOUNT_COMMIT new file mode 100644 index 00000000..61460309 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/ABSTRACT_ACCOUNT_COMMIT @@ -0,0 +1 @@ +2c933a7b2a8dacc0ae5bf4344159a7d4ab080135 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.rs b/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.rs new file mode 100644 index 00000000..e42194e7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.rs @@ -0,0 +1,129 @@ +// @generated +/// AbstractAccount is a smart contract that is capable of initiating txs. +/// +/// This account type is similar to BaseAccount except for it doesn't have a +/// pubkey. If a pubkey is needed, it creates and returns a new NilPubKey. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AbstractAccount { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub account_number: u64, + #[prost(uint64, tag = "3")] + pub sequence: u64, +} +/// NilPubKey is the pubkey type of the AbstractAccount. Basically, it represents +/// a pubkey that doesn't exist. +/// +/// The actual pubkey of an AbstractAccount (if it has one) is to be stored +/// inside the contract, not at the SDK level. Signature verification is also +/// done inside the contract, typically in the BeforeTx hook. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct NilPubKey { + #[prost(bytes = "vec", tag = "1")] + pub address_bytes: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventAccountRegistered { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub code_id: u64, + #[prost(string, tag = "3")] + pub contract_addr: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// AllowAllCodeIDs determines whether a Wasm code ID can be used to register + /// AbstractAccounts: + /// - if set to true, any code ID can be used; + /// - if set to false, only code IDs whitelisted in the AllowedCodeIDs list can + /// be used. + #[prost(bool, tag = "1")] + pub allow_all_code_ids: bool, + /// AllowedCodeIDs is the whitelist of Wasm code IDs that can be used to + /// regiseter AbstractAccounts. + #[prost(uint64, repeated, packed = "false", tag = "2")] + pub allowed_code_ids: ::prost::alloc::vec::Vec, + /// MaxGasBefore is the maximum amount of gas that can be consumed by the + /// contract call in the before_tx decorator. + /// + /// Must be greater than zero. + #[prost(uint64, tag = "3")] + pub max_gas_before: u64, + /// MaxGasAfter is the maximum amount of gas that can be consumed by the + /// contract call in the after_tx decorator. + /// + /// Must be greater than zero. + #[prost(uint64, tag = "4")] + pub max_gas_after: u64, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub next_account_id: u64, +} +// ---------------------------------- Params ----------------------------------- + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +// ------------------------------- UpdateParams -------------------------------- + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +// ------------------------------ RegisterAccount ------------------------------ + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterAccount { + /// Sender is the actor who signs the message + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// CodeID indicates which wasm binary code is to be used for this contract + #[prost(uint64, tag = "2")] + pub code_id: u64, + /// Msg is the JSON-encoded instantiate message for the contract + #[prost(bytes = "vec", tag = "3")] + pub msg: ::prost::alloc::vec::Vec, + /// Funds are coins to be deposited to the contract on instantiattion + #[prost(message, repeated, tag = "4")] + pub funds: ::prost::alloc::vec::Vec, + /// Salt is an arbinary value to be used in deriving the account address. + /// Max 64 bytes. + #[prost(bytes = "vec", tag = "5")] + pub salt: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterAccountResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub data: ::prost::alloc::vec::Vec, +} +include!("abstractaccount.v1.serde.rs"); +include!("abstractaccount.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.serde.rs b/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.serde.rs new file mode 100644 index 00000000..a9bedf1e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.serde.rs @@ -0,0 +1,1370 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AbstractAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.account_number != 0 { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("abstractaccount.v1.AbstractAccount", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if self.account_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "accountNumber", + ToString::to_string(&self.account_number).as_str(), + )?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AbstractAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "account_number", "accountNumber", "sequence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + AccountNumber, + Sequence, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + "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 = AbstractAccount; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.AbstractAccount") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = 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::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(AbstractAccount { + address: address__.unwrap_or_default(), + account_number: account_number__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.AbstractAccount", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventAccountRegistered { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.creator.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.contract_addr.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("abstractaccount.v1.EventAccountRegistered", len)?; + if !self.creator.is_empty() { + struct_ser.serialize_field("creator", &self.creator)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.contract_addr.is_empty() { + struct_ser.serialize_field("contractAddr", &self.contract_addr)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventAccountRegistered { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "creator", + "code_id", + "codeId", + "contract_addr", + "contractAddr", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Creator, + CodeId, + ContractAddr, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "creator" => Ok(GeneratedField::Creator), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "contractAddr" | "contract_addr" => Ok(GeneratedField::ContractAddr), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventAccountRegistered; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.EventAccountRegistered") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut creator__ = None; + let mut code_id__ = None; + let mut contract_addr__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Creator => { + if creator__.is_some() { + return Err(serde::de::Error::duplicate_field("creator")); + } + creator__ = 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::ContractAddr => { + if contract_addr__.is_some() { + return Err(serde::de::Error::duplicate_field("contractAddr")); + } + contract_addr__ = Some(map_.next_value()?); + } + } + } + Ok(EventAccountRegistered { + creator: creator__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + contract_addr: contract_addr__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.EventAccountRegistered", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if self.next_account_id != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("abstractaccount.v1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if self.next_account_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextAccountId", + ToString::to_string(&self.next_account_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params", "next_account_id", "nextAccountId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + NextAccountId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + "nextAccountId" | "next_account_id" => { + Ok(GeneratedField::NextAccountId) + } + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut next_account_id__ = 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::NextAccountId => { + if next_account_id__.is_some() { + return Err(serde::de::Error::duplicate_field("nextAccountId")); + } + next_account_id__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(GenesisState { + params: params__, + next_account_id: next_account_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("abstractaccount.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgRegisterAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + if !self.funds.is_empty() { + len += 1; + } + if !self.salt.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("abstractaccount.v1.MsgRegisterAccount", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if !self.funds.is_empty() { + struct_ser.serialize_field("funds", &self.funds)?; + } + if !self.salt.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("salt", pbjson::private::base64::encode(&self.salt).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgRegisterAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "code_id", "codeId", "msg", "funds", "salt"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + CodeId, + Msg, + Funds, + Salt, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "codeId" | "code_id" => Ok(GeneratedField::CodeId), + "msg" => Ok(GeneratedField::Msg), + "funds" => Ok(GeneratedField::Funds), + "salt" => Ok(GeneratedField::Salt), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRegisterAccount; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.MsgRegisterAccount") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut code_id__ = None; + let mut msg__ = None; + let mut funds__ = None; + let mut salt__ = 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::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, + ); + } + 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, + ); + } + } + } + Ok(MsgRegisterAccount { + sender: sender__.unwrap_or_default(), + code_id: code_id__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + funds: funds__.unwrap_or_default(), + salt: salt__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.MsgRegisterAccount", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgRegisterAccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("abstractaccount.v1.MsgRegisterAccountResponse", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgRegisterAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = MsgRegisterAccountResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.MsgRegisterAccountResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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(MsgRegisterAccountResponse { + address: address__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.MsgRegisterAccountResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("abstractaccount.v1.MsgUpdateParams", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut params__ = 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::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + sender: sender__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("abstractaccount.v1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.MsgUpdateParamsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for NilPubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address_bytes.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("abstractaccount.v1.NilPubKey", len)?; + if !self.address_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "addressBytes", + pbjson::private::base64::encode(&self.address_bytes).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for NilPubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address_bytes", "addressBytes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressBytes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = NilPubKey; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.NilPubKey") + } + + fn visit_map(self, mut map_: V) -> std::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(NilPubKey { + address_bytes: address_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("abstractaccount.v1.NilPubKey", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.allow_all_code_ids { + len += 1; + } + if !self.allowed_code_ids.is_empty() { + len += 1; + } + if self.max_gas_before != 0 { + len += 1; + } + if self.max_gas_after != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("abstractaccount.v1.Params", len)?; + if self.allow_all_code_ids { + struct_ser.serialize_field("allowAllCodeIds", &self.allow_all_code_ids)?; + } + if !self.allowed_code_ids.is_empty() { + struct_ser.serialize_field( + "allowedCodeIds", + &self + .allowed_code_ids + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + if self.max_gas_before != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "maxGasBefore", + ToString::to_string(&self.max_gas_before).as_str(), + )?; + } + if self.max_gas_after != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "maxGasAfter", + ToString::to_string(&self.max_gas_after).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "allow_all_code_ids", + "allowAllCodeIds", + "allowed_code_ids", + "allowedCodeIds", + "max_gas_before", + "maxGasBefore", + "max_gas_after", + "maxGasAfter", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AllowAllCodeIds, + AllowedCodeIds, + MaxGasBefore, + MaxGasAfter, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "allowAllCodeIds" | "allow_all_code_ids" => { + Ok(GeneratedField::AllowAllCodeIds) + } + "allowedCodeIds" | "allowed_code_ids" => { + Ok(GeneratedField::AllowedCodeIds) + } + "maxGasBefore" | "max_gas_before" => Ok(GeneratedField::MaxGasBefore), + "maxGasAfter" | "max_gas_after" => Ok(GeneratedField::MaxGasAfter), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.Params") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allow_all_code_ids__ = None; + let mut allowed_code_ids__ = None; + let mut max_gas_before__ = None; + let mut max_gas_after__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AllowAllCodeIds => { + if allow_all_code_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("allowAllCodeIds")); + } + allow_all_code_ids__ = Some(map_.next_value()?); + } + GeneratedField::AllowedCodeIds => { + if allowed_code_ids__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedCodeIds")); + } + allowed_code_ids__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + GeneratedField::MaxGasBefore => { + if max_gas_before__.is_some() { + return Err(serde::de::Error::duplicate_field("maxGasBefore")); + } + max_gas_before__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::MaxGasAfter => { + if max_gas_after__.is_some() { + return Err(serde::de::Error::duplicate_field("maxGasAfter")); + } + max_gas_after__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Params { + allow_all_code_ids: allow_all_code_ids__.unwrap_or_default(), + allowed_code_ids: allowed_code_ids__.unwrap_or_default(), + max_gas_before: max_gas_before__.unwrap_or_default(), + max_gas_after: max_gas_after__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("abstractaccount.v1.Params", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("abstractaccount.v1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest {}) + } + } + deserializer.deserialize_struct( + "abstractaccount.v1.QueryParamsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("abstractaccount.v1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct abstractaccount.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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( + "abstractaccount.v1.QueryParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.tonic.rs b/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.tonic.rs new file mode 100644 index 00000000..21fe4465 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/abstractaccount.v1.tonic.rs @@ -0,0 +1,599 @@ +// @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("/abstractaccount.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("abstractaccount.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() { + "/abstractaccount.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 = "abstractaccount.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("/abstractaccount.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("abstractaccount.v1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + pub async fn register_account( + &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("/abstractaccount.v1.Msg/RegisterAccount"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("abstractaccount.v1.Msg", "RegisterAccount")); + 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>; + async fn register_account( + &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() { + "/abstractaccount.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) + } + "/abstractaccount.v1.Msg/RegisterAccount" => { + #[allow(non_camel_case_types)] + struct RegisterAccountSvc(pub Arc); + impl tonic::server::UnaryService for RegisterAccountSvc { + type Response = super::MsgRegisterAccountResponse; + 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).register_account(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = RegisterAccountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "abstractaccount.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/abstract-account/amino.rs b/cosmos-sdk-proto/src/prost/abstract-account/amino.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/amino.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.auth.v1beta1.rs new file mode 100644 index 00000000..72beb305 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.auth.v1beta1.rs @@ -0,0 +1,58 @@ +// @generated +/// BaseAccount defines a base account type. It contains all the necessary fields +/// for basic account functionality. Any custom account type should extend this +/// type for additional functionality (e.g. vesting). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BaseAccount { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + #[prost(uint64, tag = "3")] + pub account_number: u64, + #[prost(uint64, tag = "4")] + pub sequence: u64, +} +/// 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>, +} +/// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleCredential { + /// module_name is the name of the module used for address derivation (passed into address.Module). + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, + /// derivation_keys is for deriving a module account address (passed into address.Module) + /// adding more keys creates sub-account addresses (passed into address.Derive) + #[prost(bytes = "vec", repeated, tag = "2")] + pub derivation_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +/// 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, +} +include!("cosmos.auth.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos.auth.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.auth.v1beta1.serde.rs new file mode 100644 index 00000000..8c72b207 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.auth.v1beta1.serde.rs @@ -0,0 +1,646 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for BaseAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pub_key.is_some() { + len += 1; + } + if self.account_number != 0 { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.BaseAccount", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pub_key.as_ref() { + struct_ser.serialize_field("pubKey", v)?; + } + if self.account_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "accountNumber", + ToString::to_string(&self.account_number).as_str(), + )?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BaseAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.BaseAccount") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_account.is_some() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.permissions.is_empty() { + 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 !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.permissions.is_empty() { + struct_ser.serialize_field("permissions", &self.permissions)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.ModuleAccount") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleCredential { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.module_name.is_empty() { + len += 1; + } + if !self.derivation_keys.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.ModuleCredential", len)?; + if !self.module_name.is_empty() { + struct_ser.serialize_field("moduleName", &self.module_name)?; + } + if !self.derivation_keys.is_empty() { + struct_ser.serialize_field( + "derivationKeys", + &self + .derivation_keys + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleCredential { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.ModuleCredential") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.max_memo_characters != 0 { + len += 1; + } + if self.tx_sig_limit != 0 { + len += 1; + } + if self.tx_size_cost_per_byte != 0 { + len += 1; + } + if self.sig_verify_cost_ed25519 != 0 { + len += 1; + } + if self.sig_verify_cost_secp256k1 != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Params", len)?; + if self.max_memo_characters != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "maxMemoCharacters", + ToString::to_string(&self.max_memo_characters).as_str(), + )?; + } + if self.tx_sig_limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "txSigLimit", + ToString::to_string(&self.tx_sig_limit).as_str(), + )?; + } + if self.tx_size_cost_per_byte != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "txSizeCostPerByte", + ToString::to_string(&self.tx_size_cost_per_byte).as_str(), + )?; + } + if self.sig_verify_cost_ed25519 != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "sigVerifyCostEd25519", + ToString::to_string(&self.sig_verify_cost_ed25519).as_str(), + )?; + } + if self.sig_verify_cost_secp256k1 != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "sigVerifyCostSecp256k1", + ToString::to_string(&self.sig_verify_cost_secp256k1).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.base.v1beta1.rs new file mode 100644 index 00000000..8a02bbd7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.base.v1beta1.rs @@ -0,0 +1,41 @@ +// @generated +/// 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, +} +include!("cosmos.base.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos.base.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..92880130 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.base.v1beta1.serde.rs @@ -0,0 +1,413 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Coin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.Coin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Coin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.Coin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecCoin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecCoin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecCoin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecCoin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.dec.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecProto", len)?; + if !self.dec.is_empty() { + struct_ser.serialize_field("dec", &self.dec)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["dec"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Dec, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecProto") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for IntProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.int.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.IntProto", len)?; + if !self.int.is_empty() { + struct_ser.serialize_field("int", &self.int)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for IntProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["int"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Int, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.IntProto") + } + + fn visit_map(self, mut map_: V) -> std::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/abstract-account/cosmos.msg.v1.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.msg.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.msg.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos.query.v1.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.query.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos.query.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos_proto.rs new file mode 100644 index 00000000..2353a154 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos_proto.rs @@ -0,0 +1,76 @@ +// @generated +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterfaceDescriptor { + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScalarDescriptor { + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + #[prost(enumeration = "ScalarType", repeated, tag = "3")] + pub field_type: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ScalarType { + Unspecified = 0, + String = 1, + Bytes = 2, +} +impl ScalarType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + ScalarType::String => "SCALAR_TYPE_STRING", + ScalarType::Bytes => "SCALAR_TYPE_BYTES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SCALAR_TYPE_STRING" => Some(Self::String), + "SCALAR_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } +} +include!("cosmos_proto.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/abstract-account/cosmos_proto.serde.rs b/cosmos-sdk-proto/src/prost/abstract-account/cosmos_proto.serde.rs new file mode 100644 index 00000000..0ebdf0ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/abstract-account/cosmos_proto.serde.rs @@ -0,0 +1,334 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos_proto.InterfaceDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "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 = InterfaceDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(InterfaceDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos_proto.InterfaceDescriptor", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.field_type.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos_proto.ScalarDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.field_type.is_empty() { + let v = self + .field_type + .iter() + .cloned() + .map(|v| { + ScalarType::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }) + .collect::, _>>()?; + struct_ser.serialize_field("fieldType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description", "field_type", "fieldType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + FieldType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + "fieldType" | "field_type" => Ok(GeneratedField::FieldType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.ScalarDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + let mut field_type__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::FieldType => { + if field_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldType")); + } + field_type__ = Some( + map_.next_value::>()? + .into_iter() + .map(|x| x as i32) + .collect(), + ); + } + } + } + Ok(ScalarDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + field_type: field_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos_proto.ScalarDescriptor", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCALAR_TYPE_UNSPECIFIED", + "SCALAR_TYPE_STRING", + "SCALAR_TYPE_BYTES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Ok(ScalarType::Unspecified), + "SCALAR_TYPE_STRING" => Ok(ScalarType::String), + "SCALAR_TYPE_BYTES" => Ok(ScalarType::Bytes), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs index c37f344f..55572462 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs @@ -1,5 +1,7 @@ // @generated /// Module is the module config object for the cosmos.app v1 app module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} +include!("cosmos.app.module.v1alpha1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.serde.rs new file mode 100644 index 00000000..5bf71429 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.serde.rs @@ -0,0 +1,79 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.app.module.v1alpha1.Module", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.module.v1alpha1.Module") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(Module {}) + } + } + deserializer.deserialize_struct( + "cosmos.app.module.v1alpha1.Module", + 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..9a00831f 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 @@ -1,5 +1,6 @@ // @generated /// ModuleDescriptor describes an app module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleDescriptor { /// go_import names the package that should be imported by an app to load the @@ -24,6 +25,7 @@ pub struct ModuleDescriptor { pub can_migrate_from: ::prost::alloc::vec::Vec, } /// PackageReference is a reference to a protobuf package used by a module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PackageReference { /// name is the fully-qualified name of the package. @@ -69,6 +71,7 @@ pub struct PackageReference { } /// MigrateFromInfo is information on a module version that a newer module /// can migrate from. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MigrateFromInfo { /// module is the fully-qualified protobuf name of the module config object @@ -83,6 +86,7 @@ pub struct MigrateFromInfo { /// allow a mixture of declarative and imperative app wiring, however, apps /// that strive for the maximum ease of maintainability should be able to describe /// their state machine with a config object alone. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Config { /// modules are the module configurations for the app. @@ -90,6 +94,7 @@ pub struct Config { pub modules: ::prost::alloc::vec::Vec, } /// ModuleConfig is a module configuration for an app. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleConfig { /// name is the unique name of the module within the app. It should be a name @@ -107,17 +112,20 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// QueryConfigRequest is the Query/Config request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConfigRequest {} /// QueryConfigRequest is the Query/Config response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConfigResponse { /// config is the current app config. #[prost(message, optional, tag = "1")] pub config: ::core::option::Option, } +include!("cosmos.app.v1alpha1.serde.rs"); include!("cosmos.app.v1alpha1.tonic.rs"); // @@protoc_insertion_point(module) 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..7382e8c6 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.serde.rs @@ -0,0 +1,749 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Config { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.modules.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.app.v1alpha1.Config", len)?; + if !self.modules.is_empty() { + struct_ser.serialize_field("modules", &self.modules)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Config { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["modules"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Modules, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "modules" => Ok(GeneratedField::Modules), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.Config") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut modules__ = 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()?); + } + } + } + Ok(Config { + modules: modules__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.app.v1alpha1.Config", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MigrateFromInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.module.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.app.v1alpha1.MigrateFromInfo", len)?; + if !self.module.is_empty() { + struct_ser.serialize_field("module", &self.module)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MigrateFromInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["module"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Module, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.MigrateFromInfo") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.config.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.app.v1alpha1.ModuleConfig", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.config.as_ref() { + struct_ser.serialize_field("config", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "config"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Config, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "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 = ModuleConfig; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.ModuleConfig") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut config__ = 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()?; + } + } + } + Ok(ModuleConfig { + name: name__.unwrap_or_default(), + config: config__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.app.v1alpha1.ModuleConfig", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.go_import.is_empty() { + len += 1; + } + if !self.use_package.is_empty() { + len += 1; + } + if !self.can_migrate_from.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.app.v1alpha1.ModuleDescriptor", len)?; + if !self.go_import.is_empty() { + struct_ser.serialize_field("goImport", &self.go_import)?; + } + if !self.use_package.is_empty() { + struct_ser.serialize_field("usePackage", &self.use_package)?; + } + if !self.can_migrate_from.is_empty() { + struct_ser.serialize_field("canMigrateFrom", &self.can_migrate_from)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.ModuleDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PackageReference { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.revision != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.app.v1alpha1.PackageReference", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.revision != 0 { + struct_ser.serialize_field("revision", &self.revision)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PackageReference { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "revision"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Revision, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.PackageReference") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryConfigRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryConfigRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.QueryConfigRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryConfigResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.config.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryConfigResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["config"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Config, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.app.v1alpha1.QueryConfigResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs index e14153ef..c133406e 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 @@ -2,18 +2,20 @@ /// 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>, + pub pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(uint64, tag = "3")] pub account_number: u64, #[prost(uint64, tag = "4")] pub sequence: u64, } /// 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")] @@ -24,6 +26,7 @@ pub struct ModuleAccount { 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")] @@ -38,6 +41,7 @@ pub struct Params { pub sig_verify_cost_secp256k1: u64, } /// GenesisState defines the auth module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the paramaters of the module. @@ -45,11 +49,12 @@ pub struct GenesisState { 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<::tendermint_proto::google::protobuf::Any>, } /// QueryAccountsRequest is the request type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsRequest { /// pagination defines an optional pagination for the request. @@ -59,16 +64,18 @@ pub struct QueryAccountsRequest { /// QueryAccountsResponse is the response type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsResponse { /// accounts are the existing accounts #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub accounts: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryAccountRequest is the request type for the Query/Account RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountRequest { /// address defines the address to query for. @@ -76,16 +83,19 @@ pub struct QueryAccountRequest { pub address: ::prost::alloc::string::String, } /// QueryAccountResponse is the response type for the Query/Account RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountResponse { /// account defines the account of the corresponding address. #[prost(message, optional, tag = "1")] - pub account: ::core::option::Option<::prost_types::Any>, + pub account: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } /// 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. @@ -95,36 +105,42 @@ pub struct QueryParamsResponse { /// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsRequest {} /// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsResponse { #[prost(message, repeated, tag = "1")] - pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub accounts: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, } /// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountByNameRequest { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } /// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountByNameResponse { #[prost(message, optional, tag = "1")] - pub account: ::core::option::Option<::prost_types::Any>, + pub account: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } /// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bech32PrefixRequest {} /// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bech32PrefixResponse { #[prost(string, tag = "1")] @@ -133,6 +149,7 @@ pub struct Bech32PrefixResponse { /// AddressBytesToStringRequest is the request type for AddressString rpc method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressBytesToStringRequest { #[prost(bytes = "vec", tag = "1")] @@ -141,6 +158,7 @@ pub struct AddressBytesToStringRequest { /// AddressBytesToStringResponse is the response type for AddressString rpc method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressBytesToStringResponse { #[prost(string, tag = "1")] @@ -149,6 +167,7 @@ pub struct AddressBytesToStringResponse { /// AddressStringToBytesRequest is the request type for AccountBytes rpc method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressStringToBytesRequest { #[prost(string, tag = "1")] @@ -157,6 +176,7 @@ pub struct AddressStringToBytesRequest { /// AddressStringToBytesResponse is the response type for AddressBytes rpc method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressStringToBytesResponse { #[prost(bytes = "vec", tag = "1")] @@ -165,6 +185,7 @@ pub struct AddressStringToBytesResponse { /// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method /// /// Since: cosmos-sdk 0.46.2 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdRequest { /// id is the account number of the address to be queried. This field @@ -176,10 +197,12 @@ pub struct QueryAccountAddressByIdRequest { /// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method /// /// Since: cosmos-sdk 0.46.2 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdResponse { #[prost(string, tag = "1")] pub account_address: ::prost::alloc::string::String, } +include!("cosmos.auth.v1beta1.serde.rs"); 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..7345e5a5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.serde.rs @@ -0,0 +1,2436 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AddressBytesToStringRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address_bytes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.AddressBytesToStringRequest", len)?; + if !self.address_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "addressBytes", + pbjson::private::base64::encode(&self.address_bytes).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AddressBytesToStringRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address_bytes", "addressBytes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressBytes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressBytesToStringRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AddressBytesToStringResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address_string.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.AddressBytesToStringResponse", len)?; + if !self.address_string.is_empty() { + struct_ser.serialize_field("addressString", &self.address_string)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AddressBytesToStringResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address_string", "addressString"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressString, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressBytesToStringResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AddressStringToBytesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address_string.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.AddressStringToBytesRequest", len)?; + if !self.address_string.is_empty() { + struct_ser.serialize_field("addressString", &self.address_string)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AddressStringToBytesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address_string", "addressString"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressString, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressStringToBytesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AddressStringToBytesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address_bytes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.AddressStringToBytesResponse", len)?; + if !self.address_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "addressBytes", + pbjson::private::base64::encode(&self.address_bytes).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AddressStringToBytesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address_bytes", "addressBytes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AddressBytes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.AddressStringToBytesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for BaseAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pub_key.is_some() { + len += 1; + } + if self.account_number != 0 { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.BaseAccount", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pub_key.as_ref() { + struct_ser.serialize_field("pubKey", v)?; + } + if self.account_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "accountNumber", + ToString::to_string(&self.account_number).as_str(), + )?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BaseAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.BaseAccount") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Bech32PrefixRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Bech32PrefixRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Bech32PrefixRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Bech32PrefixResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.bech32_prefix.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.Bech32PrefixResponse", len)?; + if !self.bech32_prefix.is_empty() { + struct_ser.serialize_field("bech32Prefix", &self.bech32_prefix)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Bech32PrefixResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["bech32_prefix", "bech32Prefix"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bech32Prefix, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Bech32PrefixResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.accounts.is_empty() { + 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 !self.accounts.is_empty() { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params", "accounts"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + Accounts, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_account.is_some() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.permissions.is_empty() { + 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 !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.permissions.is_empty() { + struct_ser.serialize_field("permissions", &self.permissions)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.ModuleAccount") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.max_memo_characters != 0 { + len += 1; + } + if self.tx_sig_limit != 0 { + len += 1; + } + if self.tx_size_cost_per_byte != 0 { + len += 1; + } + if self.sig_verify_cost_ed25519 != 0 { + len += 1; + } + if self.sig_verify_cost_secp256k1 != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.auth.v1beta1.Params", len)?; + if self.max_memo_characters != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "maxMemoCharacters", + ToString::to_string(&self.max_memo_characters).as_str(), + )?; + } + if self.tx_sig_limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "txSigLimit", + ToString::to_string(&self.tx_sig_limit).as_str(), + )?; + } + if self.tx_size_cost_per_byte != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "txSizeCostPerByte", + ToString::to_string(&self.tx_size_cost_per_byte).as_str(), + )?; + } + if self.sig_verify_cost_ed25519 != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "sigVerifyCostEd25519", + ToString::to_string(&self.sig_verify_cost_ed25519).as_str(), + )?; + } + if self.sig_verify_cost_secp256k1 != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "sigVerifyCostSecp256k1", + ToString::to_string(&self.sig_verify_cost_secp256k1).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountAddressByIdRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.id != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", len)?; + if self.id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountAddressByIdRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["id"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryAccountAddressByIdRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountAddressByIDRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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(QueryAccountAddressByIdRequest { + id: id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.auth.v1beta1.QueryAccountAddressByIDRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountAddressByIdResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.account_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.auth.v1beta1.QueryAccountAddressByIDResponse", len)?; + if !self.account_address.is_empty() { + struct_ser.serialize_field("accountAddress", &self.account_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountAddressByIdResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["account_address", "accountAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AccountAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountAddressByIDResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.account.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["account"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Account, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.accounts.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.QueryAccountsResponse", len)?; + if !self.accounts.is_empty() { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["accounts", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Accounts, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryAccountsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryModuleAccountByNameRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountByNameRequest", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryModuleAccountByNameRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountByNameRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryModuleAccountByNameResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.account.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryModuleAccountByNameResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["account"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Account, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountByNameResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryModuleAccountsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryModuleAccountsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryModuleAccountsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.accounts.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.QueryModuleAccountsResponse", len)?; + if !self.accounts.is_empty() { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryModuleAccountsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["accounts"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Accounts, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryModuleAccountsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.authz.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs index 8d38d9f9..79556512 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 @@ -1,6 +1,7 @@ // @generated /// GenericAuthorization gives the grantee unrestricted permissions to execute /// the provided method on behalf of the granter's account. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenericAuthorization { /// Msg, identified by it's type URL, to grant unrestricted permissions to execute @@ -9,18 +10,20 @@ pub struct GenericAuthorization { } /// Grant gives permissions to execute /// the provide method with expiration time. +#[allow(clippy::derive_partial_eq_without_eq)] #[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<::tendermint_proto::google::protobuf::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<::tendermint_proto::google::protobuf::Timestamp>, } /// GrantAuthorization extends a grant with both the addresses of the grantee and granter. /// It is used in genesis.proto and query.proto +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrantAuthorization { #[prost(string, tag = "1")] @@ -28,11 +31,12 @@ 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<::tendermint_proto::google::protobuf::Any>, #[prost(message, optional, tag = "4")] - pub expiration: ::core::option::Option<::prost_types::Timestamp>, + pub expiration: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, } /// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrantQueueItem { /// msg_type_urls contains the list of TypeURL of a sdk.Msg. @@ -40,6 +44,7 @@ pub struct GrantQueueItem { pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// EventGrant is emitted on Msg/Grant +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventGrant { /// Msg type URL for which an autorization is granted @@ -53,6 +58,7 @@ pub struct EventGrant { pub grantee: ::prost::alloc::string::String, } /// EventRevoke is emitted on Msg/Revoke +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventRevoke { /// Msg type URL for which an autorization is revoked @@ -66,12 +72,14 @@ pub struct EventRevoke { pub grantee: ::prost::alloc::string::String, } /// GenesisState defines the authz module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] pub authorization: ::prost::alloc::vec::Vec, } /// QueryGrantsRequest is the request type for the Query/Grants RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGrantsRequest { #[prost(string, tag = "1")] @@ -86,6 +94,7 @@ pub struct QueryGrantsRequest { pub pagination: ::core::option::Option, } /// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGrantsResponse { /// authorizations is a list of grants granted for grantee by granter. @@ -96,6 +105,7 @@ pub struct QueryGrantsResponse { pub pagination: ::core::option::Option, } /// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranterGrantsRequest { #[prost(string, tag = "1")] @@ -105,6 +115,7 @@ pub struct QueryGranterGrantsRequest { pub pagination: ::core::option::Option, } /// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranterGrantsResponse { /// grants is a list of grants granted by the granter. @@ -115,6 +126,7 @@ pub struct QueryGranterGrantsResponse { pub pagination: ::core::option::Option, } /// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranteeGrantsRequest { #[prost(string, tag = "1")] @@ -124,6 +136,7 @@ pub struct QueryGranteeGrantsRequest { pub pagination: ::core::option::Option, } /// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranteeGrantsResponse { /// grants is a list of grants granted to the grantee. @@ -135,6 +148,7 @@ pub struct QueryGranteeGrantsResponse { } /// MsgGrant is a request type for Grant method. It declares authorization to the grantee /// on behalf of the granter with the provided expiration time. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrant { #[prost(string, tag = "1")] @@ -145,6 +159,7 @@ pub struct MsgGrant { pub grant: ::core::option::Option, } /// MsgExecResponse defines the Msg/MsgExecResponse response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecResponse { #[prost(bytes = "vec", repeated, tag = "1")] @@ -153,6 +168,7 @@ pub struct MsgExecResponse { /// MsgExec attempts to execute the provided messages using /// authorizations granted to the grantee. Each message should have only /// one signer corresponding to the granter of the authorization. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExec { #[prost(string, tag = "1")] @@ -161,13 +177,15 @@ pub struct MsgExec { /// 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<::tendermint_proto::google::protobuf::Any>, } /// MsgGrantResponse defines the Msg/MsgGrant response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantResponse {} /// MsgRevoke revokes any authorization with the provided sdk.Msg type on the /// granter's account with that has been granted to the grantee. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevoke { #[prost(string, tag = "1")] @@ -178,7 +196,9 @@ pub struct MsgRevoke { pub msg_type_url: ::prost::alloc::string::String, } /// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeResponse {} +include!("cosmos.authz.v1beta1.serde.rs"); include!("cosmos.authz.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..20ee2f3e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.serde.rs @@ -0,0 +1,2203 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for EventGrant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.msg_type_url.is_empty() { + len += 1; + } + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.EventGrant", len)?; + if !self.msg_type_url.is_empty() { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventGrant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.EventGrant") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventRevoke { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.msg_type_url.is_empty() { + len += 1; + } + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.EventRevoke", len)?; + if !self.msg_type_url.is_empty() { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventRevoke { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.EventRevoke") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenericAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.msg.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.GenericAuthorization", len)?; + if !self.msg.is_empty() { + struct_ser.serialize_field("msg", &self.msg)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenericAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["msg"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Msg, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GenericAuthorization") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authorization.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.GenesisState", len)?; + if !self.authorization.is_empty() { + struct_ser.serialize_field("authorization", &self.authorization)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authorization"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authorization, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Grant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.authorization.is_some() { + len += 1; + } + if self.expiration.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Grant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authorization", "expiration"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authorization, + Expiration, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.Grant") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GrantAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if self.authorization.is_some() { + len += 1; + } + if self.expiration.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.GrantAuthorization", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GrantAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GrantAuthorization") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GrantQueueItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.msg_type_urls.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.GrantQueueItem", len)?; + if !self.msg_type_urls.is_empty() { + struct_ser.serialize_field("msgTypeUrls", &self.msg_type_urls)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GrantQueueItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["msg_type_urls", "msgTypeUrls"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgTypeUrls, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.GrantQueueItem") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.grantee.is_empty() { + len += 1; + } + if !self.msgs.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.MsgExec", len)?; + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if !self.msgs.is_empty() { + struct_ser.serialize_field("msgs", &self.msgs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["grantee", "msgs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grantee, + Msgs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgExec") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExecResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.results.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.MsgExecResponse", len)?; + if !self.results.is_empty() { + struct_ser.serialize_field( + "results", + &self + .results + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExecResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["results"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Results, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgExecResponse") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(MsgExecResponse { + results: results__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.authz.v1beta1.MsgExecResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgGrant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if self.grant.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.MsgGrant", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.grant.as_ref() { + struct_ser.serialize_field("grant", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgGrant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "grantee", "grant"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Grant, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgGrant") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgGrantResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgGrantResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgGrantResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgRevoke { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if !self.msg_type_url.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.authz.v1beta1.MsgRevoke", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if !self.msg_type_url.is_empty() { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgRevoke { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgRevoke") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgRevokeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgRevokeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.MsgRevokeResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGranteeGrantsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.grantee.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranteeGrantsRequest", len)?; + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGranteeGrantsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["grantee", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grantee, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranteeGrantsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGranteeGrantsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.grants.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranteeGrantsResponse", len)?; + if !self.grants.is_empty() { + struct_ser.serialize_field("grants", &self.grants)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGranteeGrantsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["grants", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grants, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranteeGrantsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGranterGrantsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranterGrantsRequest", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGranterGrantsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranterGrantsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGranterGrantsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.grants.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.QueryGranterGrantsResponse", len)?; + if !self.grants.is_empty() { + struct_ser.serialize_field("grants", &self.grants)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGranterGrantsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["grants", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grants, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGranterGrantsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGrantsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if !self.msg_type_url.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.QueryGrantsRequest", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if !self.msg_type_url.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGrantsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGrantsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGrantsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.grants.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.authz.v1beta1.QueryGrantsResponse", len)?; + if !self.grants.is_empty() { + struct_ser.serialize_field("grants", &self.grants)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGrantsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["grants", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grants, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.authz.v1beta1.QueryGrantsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs index 4574722a..996d974c 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 @@ -3,12 +3,14 @@ /// the granter's account. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendAuthorization { #[prost(message, repeated, tag = "1")] pub spend_limit: ::prost::alloc::vec::Vec, } /// Params defines the parameters for the bank module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { #[prost(message, repeated, tag = "1")] @@ -18,6 +20,7 @@ pub struct Params { } /// SendEnabled maps coin denom to a send_enabled status (whether a denom is /// sendable). +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendEnabled { #[prost(string, tag = "1")] @@ -26,6 +29,7 @@ pub struct SendEnabled { pub enabled: bool, } /// Input models transaction input. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Input { #[prost(string, tag = "1")] @@ -34,6 +38,7 @@ pub struct Input { pub coins: ::prost::alloc::vec::Vec, } /// Output models transaction outputs. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Output { #[prost(string, tag = "1")] @@ -44,6 +49,7 @@ pub struct Output { /// Supply represents a struct that passively keeps track of the total supply /// amounts in the network. /// This message is deprecated now that supply is indexed by denom. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Supply { #[prost(message, repeated, tag = "1")] @@ -51,6 +57,7 @@ pub struct Supply { } /// DenomUnit represents a struct that describes a given /// denomination unit of the basic token. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomUnit { /// denom represents the string name of the given denom unit (e.g uatom). @@ -69,6 +76,7 @@ pub struct DenomUnit { } /// Metadata represents a struct that describes /// a basic token. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { #[prost(string, tag = "1")] @@ -107,6 +115,7 @@ pub struct Metadata { pub uri_hash: ::prost::alloc::string::String, } /// GenesisState defines the bank module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the paramaters of the module. @@ -125,6 +134,7 @@ pub struct GenesisState { } /// Balance defines an account address and balance pair used in the bank module's /// genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Balance { /// address is the address of the balance holder. @@ -135,6 +145,7 @@ pub struct Balance { pub coins: ::prost::alloc::vec::Vec, } /// QueryBalanceRequest is the request type for the Query/Balance RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { /// address is the address to query balances for. @@ -145,6 +156,7 @@ pub struct QueryBalanceRequest { pub denom: ::prost::alloc::string::String, } /// QueryBalanceResponse is the response type for the Query/Balance RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { /// balance is the balance of the coin. @@ -152,6 +164,7 @@ pub struct QueryBalanceResponse { pub balance: ::core::option::Option, } /// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesRequest { /// address is the address to query balances for. @@ -163,6 +176,7 @@ pub struct QueryAllBalancesRequest { } /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllBalancesResponse { /// balances is the balances of all the coins. @@ -176,6 +190,7 @@ pub struct QueryAllBalancesResponse { /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { /// address is the address to query spendable balances for. @@ -189,6 +204,7 @@ pub struct QuerySpendableBalancesRequest { /// an account's spendable balances. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { /// balances is the spendable balances of all the coins. @@ -200,6 +216,7 @@ pub struct QuerySpendableBalancesResponse { } /// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyRequest { /// pagination defines an optional pagination for the request. @@ -210,6 +227,7 @@ pub struct QueryTotalSupplyRequest { } /// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyResponse { /// supply is the supply of the coins @@ -222,6 +240,7 @@ pub struct QueryTotalSupplyResponse { pub pagination: ::core::option::Option, } /// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfRequest { /// denom is the coin denom to query balances for. @@ -229,6 +248,7 @@ pub struct QuerySupplyOfRequest { pub denom: ::prost::alloc::string::String, } /// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyOfResponse { /// amount is the supply of the coin. @@ -236,15 +256,18 @@ pub struct QuerySupplyOfResponse { pub amount: ::core::option::Option, } /// QueryParamsRequest defines the request type for querying x/bank parameters. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse defines the response type for querying x/bank parameters. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } /// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataRequest { /// pagination defines an optional pagination for the request. @@ -253,6 +276,7 @@ pub struct QueryDenomsMetadataRequest { } /// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomsMetadataResponse { /// metadata provides the client information for all the registered tokens. @@ -263,6 +287,7 @@ pub struct QueryDenomsMetadataResponse { pub pagination: ::core::option::Option, } /// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataRequest { /// denom is the coin denom to query the metadata for. @@ -271,6 +296,7 @@ pub struct QueryDenomMetadataRequest { } /// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomMetadataResponse { /// metadata describes and provides all the client information for the requested token. @@ -280,6 +306,7 @@ pub struct QueryDenomMetadataResponse { /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersRequest { /// denom defines the coin denomination to query all account holders for. @@ -294,6 +321,7 @@ pub struct QueryDenomOwnersRequest { /// balance of the denominated token. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomOwner { /// address defines the address that owns a particular denomination. @@ -306,6 +334,7 @@ pub struct DenomOwner { /// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersResponse { #[prost(message, repeated, tag = "1")] @@ -315,6 +344,7 @@ pub struct QueryDenomOwnersResponse { pub pagination: ::core::option::Option, } /// MsgSend represents a message to send coins from one account to another. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { #[prost(string, tag = "1")] @@ -325,9 +355,11 @@ pub struct MsgSend { pub amount: ::prost::alloc::vec::Vec, } /// MsgSendResponse defines the Msg/Send response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendResponse {} /// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSend { #[prost(message, repeated, tag = "1")] @@ -336,7 +368,9 @@ pub struct MsgMultiSend { pub outputs: ::prost::alloc::vec::Vec, } /// MsgMultiSendResponse defines the Msg/MultiSend response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMultiSendResponse {} +include!("cosmos.bank.v1beta1.serde.rs"); 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..6e721859 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs @@ -0,0 +1,3744 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Balance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Balance", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Balance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Balance") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DenomOwner { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.balance.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.DenomOwner", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.balance.as_ref() { + struct_ser.serialize_field("balance", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DenomOwner { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "balance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Balance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.DenomOwner") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DenomUnit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.exponent != 0 { + len += 1; + } + if !self.aliases.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.DenomUnit", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if self.exponent != 0 { + struct_ser.serialize_field("exponent", &self.exponent)?; + } + if !self.aliases.is_empty() { + struct_ser.serialize_field("aliases", &self.aliases)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DenomUnit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "exponent", "aliases"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Exponent, + Aliases, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.DenomUnit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.balances.is_empty() { + len += 1; + } + if !self.supply.is_empty() { + len += 1; + } + if !self.denom_metadata.is_empty() { + 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 !self.balances.is_empty() { + struct_ser.serialize_field("balances", &self.balances)?; + } + if !self.supply.is_empty() { + struct_ser.serialize_field("supply", &self.supply)?; + } + if !self.denom_metadata.is_empty() { + struct_ser.serialize_field("denomMetadata", &self.denom_metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "params", + "balances", + "supply", + "denom_metadata", + "denomMetadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + Balances, + Supply, + DenomMetadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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()?); + } + } + } + Ok(GenesisState { + params: params__, + balances: balances__.unwrap_or_default(), + supply: supply__.unwrap_or_default(), + denom_metadata: denom_metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.bank.v1beta1.GenesisState", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Input { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Input", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Input { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Input") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Metadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.description.is_empty() { + len += 1; + } + if !self.denom_units.is_empty() { + len += 1; + } + if !self.base.is_empty() { + len += 1; + } + if !self.display.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.symbol.is_empty() { + len += 1; + } + if !self.uri.is_empty() { + len += 1; + } + if !self.uri_hash.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Metadata", len)?; + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.denom_units.is_empty() { + struct_ser.serialize_field("denomUnits", &self.denom_units)?; + } + if !self.base.is_empty() { + struct_ser.serialize_field("base", &self.base)?; + } + if !self.display.is_empty() { + struct_ser.serialize_field("display", &self.display)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.symbol.is_empty() { + struct_ser.serialize_field("symbol", &self.symbol)?; + } + if !self.uri.is_empty() { + struct_ser.serialize_field("uri", &self.uri)?; + } + if !self.uri_hash.is_empty() { + struct_ser.serialize_field("uriHash", &self.uri_hash)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Metadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Metadata") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMultiSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.inputs.is_empty() { + len += 1; + } + if !self.outputs.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.MsgMultiSend", len)?; + if !self.inputs.is_empty() { + struct_ser.serialize_field("inputs", &self.inputs)?; + } + if !self.outputs.is_empty() { + struct_ser.serialize_field("outputs", &self.outputs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMultiSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["inputs", "outputs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inputs, + Outputs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.MsgMultiSend") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMultiSendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMultiSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.MsgMultiSendResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.from_address.is_empty() { + len += 1; + } + if !self.to_address.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.MsgSend", len)?; + if !self.from_address.is_empty() { + struct_ser.serialize_field("fromAddress", &self.from_address)?; + } + if !self.to_address.is_empty() { + struct_ser.serialize_field("toAddress", &self.to_address)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.MsgSend") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.MsgSendResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Output { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Output", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Output { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Output") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.send_enabled.is_empty() { + len += 1; + } + if self.default_send_enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Params", len)?; + if !self.send_enabled.is_empty() { + struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; + } + if self.default_send_enabled { + struct_ser.serialize_field("defaultSendEnabled", &self.default_send_enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllBalancesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryAllBalancesRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryAllBalancesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllBalancesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.balances.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryAllBalancesResponse", len)?; + if !self.balances.is_empty() { + struct_ser.serialize_field("balances", &self.balances)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllBalancesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["balances", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Balances, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryAllBalancesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryBalanceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.denom.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryBalanceRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryBalanceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "denom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Denom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryBalanceRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryBalanceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.balance.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryBalanceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["balance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Balance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryBalanceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomMetadataRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataRequest", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomMetadataRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomMetadataResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.metadata.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomMetadataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["metadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomOwnersRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersRequest", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomOwnersRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomOwnersResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom_owners.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersResponse", len)?; + if !self.denom_owners.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomOwnersResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom_owners", "denomOwners", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DenomOwners, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomsMetadataRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomsMetadataRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomsMetadataRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomsMetadataResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.metadatas.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomsMetadataResponse", len)?; + if !self.metadatas.is_empty() { + struct_ser.serialize_field("metadatas", &self.metadatas)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomsMetadataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["metadatas", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Metadatas, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomsMetadataResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySpendableBalancesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.bank.v1beta1.QuerySpendableBalancesRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySpendableBalancesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QuerySpendableBalancesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySpendableBalancesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.balances.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.bank.v1beta1.QuerySpendableBalancesResponse", len)?; + if !self.balances.is_empty() { + struct_ser.serialize_field("balances", &self.balances)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySpendableBalancesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["balances", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Balances, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QuerySpendableBalancesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySupplyOfRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QuerySupplyOfRequest", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySupplyOfRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QuerySupplyOfRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySupplyOfResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.amount.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySupplyOfResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QuerySupplyOfResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTotalSupplyRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTotalSupplyRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryTotalSupplyRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTotalSupplyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.supply.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.QueryTotalSupplyResponse", len)?; + if !self.supply.is_empty() { + struct_ser.serialize_field("supply", &self.supply)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTotalSupplyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["supply", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Supply, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryTotalSupplyResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SendAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.spend_limit.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.bank.v1beta1.SendAuthorization", len)?; + if !self.spend_limit.is_empty() { + struct_ser.serialize_field("spendLimit", &self.spend_limit)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SendAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["spend_limit", "spendLimit"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SpendLimit, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "spendLimit" | "spend_limit" => Ok(GeneratedField::SpendLimit), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.SendAuthorization") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut spend_limit__ = 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()?); + } + } + } + Ok(SendAuthorization { + spend_limit: spend_limit__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.bank.v1beta1.SendAuthorization", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SendEnabled { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.SendEnabled", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if self.enabled { + struct_ser.serialize_field("enabled", &self.enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SendEnabled { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "enabled"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Enabled, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.SendEnabled") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Supply { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.total.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Supply", len)?; + if !self.total.is_empty() { + struct_ser.serialize_field("total", &self.total)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Supply { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Supply") + } + + fn visit_map(self, mut map_: V) -> std::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.base.abci.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs index 6f3ec0c9..32cc85c9 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 @@ -1,6 +1,7 @@ // @generated /// TxResponse defines a structure containing relevant tx data and metadata. The /// tags are stringified and the log is JSON decoded. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxResponse { /// The block height @@ -36,7 +37,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<::tendermint_proto::google::protobuf::Any>, /// Time of the previous block. For heights > 1, it's the weighted median of /// the timestamps of the valid votes in the block.LastCommit. For height == 1, /// it's genesis time. @@ -52,6 +53,7 @@ pub struct TxResponse { pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>, } /// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciMessageLog { #[prost(uint32, tag = "1")] @@ -65,6 +67,7 @@ pub struct AbciMessageLog { } /// StringEvent defines en Event object wrapper where all the attributes /// contain key/value pairs that are strings instead of raw bytes. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StringEvent { #[prost(string, tag = "1")] @@ -74,6 +77,7 @@ pub struct StringEvent { } /// Attribute defines an attribute wrapper where the key and value are /// strings instead of raw bytes. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Attribute { #[prost(string, tag = "1")] @@ -82,6 +86,7 @@ pub struct Attribute { pub value: ::prost::alloc::string::String, } /// GasInfo defines tx execution gas context. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GasInfo { /// GasWanted is the maximum units of work we allow this tx to perform. @@ -92,6 +97,7 @@ pub struct GasInfo { pub gas_used: u64, } /// Result is the union of ResponseFormat and ResponseCheckTx. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { /// Data is any data returned from message or handler execution. It MUST be @@ -112,10 +118,11 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// SimulationResponse defines the response generated when a transaction is /// successfully simulated. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulationResponse { #[prost(message, optional, tag = "1")] @@ -125,6 +132,7 @@ pub struct SimulationResponse { } /// MsgData defines the data returned in a Result object during message /// execution. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgData { #[prost(string, tag = "1")] @@ -134,6 +142,7 @@ pub struct MsgData { } /// TxMsgData defines a list of MsgData. A transaction will have a MsgData object /// for each message. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxMsgData { /// data field is deprecated and not populated. @@ -144,9 +153,10 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// SearchTxsResult defines a structure for querying txs pageable +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SearchTxsResult { /// Count of all txs @@ -168,4 +178,5 @@ pub struct SearchTxsResult { #[prost(message, repeated, tag = "6")] pub txs: ::prost::alloc::vec::Vec, } +include!("cosmos.base.abci.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..83877efe --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs @@ -0,0 +1,1536 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AbciMessageLog { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.msg_index != 0 { + len += 1; + } + if !self.log.is_empty() { + len += 1; + } + if !self.events.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.ABCIMessageLog", len)?; + if self.msg_index != 0 { + struct_ser.serialize_field("msgIndex", &self.msg_index)?; + } + if !self.log.is_empty() { + struct_ser.serialize_field("log", &self.log)?; + } + if !self.events.is_empty() { + struct_ser.serialize_field("events", &self.events)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AbciMessageLog { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.ABCIMessageLog") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Attribute { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.Attribute", len)?; + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + if !self.value.is_empty() { + struct_ser.serialize_field("value", &self.value)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Attribute { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.Attribute") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GasInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.gas_wanted != 0 { + len += 1; + } + if self.gas_used != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.GasInfo", len)?; + if self.gas_wanted != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("gasWanted", ToString::to_string(&self.gas_wanted).as_str())?; + } + if self.gas_used != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasUsed", ToString::to_string(&self.gas_used).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GasInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.GasInfo") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.msg_type.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.MsgData", len)?; + if !self.msg_type.is_empty() { + struct_ser.serialize_field("msgType", &self.msg_type)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["msg_type", "msgType", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgType, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.MsgData") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Result { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + if !self.log.is_empty() { + len += 1; + } + if !self.events.is_empty() { + len += 1; + } + if !self.msg_responses.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.abci.v1beta1.Result", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if !self.log.is_empty() { + struct_ser.serialize_field("log", &self.log)?; + } + if !self.events.is_empty() { + struct_ser.serialize_field("events", &self.events)?; + } + if !self.msg_responses.is_empty() { + struct_ser.serialize_field("msgResponses", &self.msg_responses)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Result { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.Result") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SearchTxsResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.total_count != 0 { + len += 1; + } + if self.count != 0 { + len += 1; + } + if self.page_number != 0 { + len += 1; + } + if self.page_total != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + if !self.txs.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.SearchTxsResult", len)?; + if self.total_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "totalCount", + ToString::to_string(&self.total_count).as_str(), + )?; + } + if self.count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("count", ToString::to_string(&self.count).as_str())?; + } + if self.page_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "pageNumber", + ToString::to_string(&self.page_number).as_str(), + )?; + } + if self.page_total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("pageTotal", ToString::to_string(&self.page_total).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + if !self.txs.is_empty() { + struct_ser.serialize_field("txs", &self.txs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SearchTxsResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.SearchTxsResult") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SimulationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.gas_info.is_some() { + len += 1; + } + if self.result.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SimulationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["gas_info", "gasInfo", "result"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GasInfo, + Result, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.SimulationResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StringEvent { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.r#type.is_empty() { + len += 1; + } + if !self.attributes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.StringEvent", len)?; + if !self.r#type.is_empty() { + struct_ser.serialize_field("type", &self.r#type)?; + } + if !self.attributes.is_empty() { + struct_ser.serialize_field("attributes", &self.attributes)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StringEvent { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["type", "attributes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Attributes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.StringEvent") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TxMsgData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + if !self.msg_responses.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.TxMsgData", len)?; + if !self.data.is_empty() { + struct_ser.serialize_field("data", &self.data)?; + } + if !self.msg_responses.is_empty() { + struct_ser.serialize_field("msgResponses", &self.msg_responses)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TxMsgData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["data", "msg_responses", "msgResponses"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + MsgResponses, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.TxMsgData") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TxResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + if !self.txhash.is_empty() { + len += 1; + } + if !self.codespace.is_empty() { + len += 1; + } + if self.code != 0 { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + if !self.raw_log.is_empty() { + len += 1; + } + if !self.logs.is_empty() { + len += 1; + } + if !self.info.is_empty() { + len += 1; + } + if self.gas_wanted != 0 { + len += 1; + } + if self.gas_used != 0 { + len += 1; + } + if self.tx.is_some() { + len += 1; + } + if !self.timestamp.is_empty() { + len += 1; + } + if !self.events.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.TxResponse", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if !self.txhash.is_empty() { + struct_ser.serialize_field("txhash", &self.txhash)?; + } + if !self.codespace.is_empty() { + struct_ser.serialize_field("codespace", &self.codespace)?; + } + if self.code != 0 { + struct_ser.serialize_field("code", &self.code)?; + } + if !self.data.is_empty() { + struct_ser.serialize_field("data", &self.data)?; + } + if !self.raw_log.is_empty() { + struct_ser.serialize_field("rawLog", &self.raw_log)?; + } + if !self.logs.is_empty() { + struct_ser.serialize_field("logs", &self.logs)?; + } + if !self.info.is_empty() { + struct_ser.serialize_field("info", &self.info)?; + } + if self.gas_wanted != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("gasWanted", ToString::to_string(&self.gas_wanted).as_str())?; + } + if self.gas_used != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("gasUsed", ToString::to_string(&self.gas_used).as_str())?; + } + if let Some(v) = self.tx.as_ref() { + struct_ser.serialize_field("tx", v)?; + } + if !self.timestamp.is_empty() { + struct_ser.serialize_field("timestamp", &self.timestamp)?; + } + if !self.events.is_empty() { + struct_ser.serialize_field("events", &self.events)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.TxResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs index ac1906db..ddd20355 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs @@ -1,11 +1,13 @@ // @generated /// Pairs defines a repeated slice of Pair objects. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pairs { #[prost(message, repeated, tag = "1")] pub pairs: ::prost::alloc::vec::Vec, } /// Pair defines a key/value bytes tuple. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pair { #[prost(bytes = "vec", tag = "1")] @@ -13,4 +15,5 @@ pub struct Pair { #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } +include!("cosmos.base.kv.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..98c15527 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs @@ -0,0 +1,219 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Pair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pair", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "value", + pbjson::private::base64::encode(&self.value).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Pair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.kv.v1beta1.Pair") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Pairs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.pairs.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pairs", len)?; + if !self.pairs.is_empty() { + struct_ser.serialize_field("pairs", &self.pairs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Pairs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pairs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pairs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.kv.v1beta1.Pairs") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs index 20a2cbf8..5b2fcbb4 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs @@ -1,12 +1,15 @@ // @generated /// ConfigRequest defines the request structure for the Config gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfigRequest {} /// ConfigResponse defines the response structure for the Config gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfigResponse { #[prost(string, tag = "1")] pub minimum_gas_price: ::prost::alloc::string::String, } +include!("cosmos.base.node.v1beta1.serde.rs"); include!("cosmos.base.node.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..55dbf379 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs @@ -0,0 +1,182 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ConfigRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ConfigRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.node.v1beta1.ConfigRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ConfigResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.minimum_gas_price.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.node.v1beta1.ConfigResponse", len)?; + if !self.minimum_gas_price.is_empty() { + struct_ser.serialize_field("minimumGasPrice", &self.minimum_gas_price)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ConfigResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["minimum_gas_price", "minimumGasPrice"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MinimumGasPrice, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.node.v1beta1.ConfigResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs index f37d3872..9e79d078 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs @@ -6,6 +6,7 @@ /// 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 @@ -41,6 +42,7 @@ pub struct PageRequest { /// 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 @@ -53,4 +55,5 @@ pub struct PageResponse { #[prost(uint64, tag = "2")] pub total: u64, } +include!("cosmos.base.query.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..27639f3d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,312 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PageRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if self.offset != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + if self.count_total { + len += 1; + } + if self.reverse { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageRequest", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if self.offset != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + if self.count_total { + struct_ser.serialize_field("countTotal", &self.count_total)?; + } + if self.reverse { + struct_ser.serialize_field("reverse", &self.reverse)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PageResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.next_key.is_empty() { + len += 1; + } + if self.total != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageResponse", len)?; + if !self.next_key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextKey", + pbjson::private::base64::encode(&self.next_key).as_str(), + )?; + } + if self.total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["next_key", "nextKey", "total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextKey, + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs index d640d9f6..0f244d14 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.rs @@ -1,8 +1,10 @@ // @generated /// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListAllInterfacesRequest {} /// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListAllInterfacesResponse { /// interface_names is an array of all the registered interfaces. @@ -11,6 +13,7 @@ pub struct ListAllInterfacesResponse { } /// ListImplementationsRequest is the request type of the ListImplementations /// RPC. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListImplementationsRequest { /// interface_name defines the interface to query the implementations for. @@ -19,10 +22,12 @@ pub struct ListImplementationsRequest { } /// ListImplementationsResponse is the response type of the ListImplementations /// RPC. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListImplementationsResponse { #[prost(string, repeated, tag = "1")] pub implementation_message_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +include!("cosmos.base.reflection.v1beta1.serde.rs"); include!("cosmos.base.reflection.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..29aaa9ea --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.serde.rs @@ -0,0 +1,414 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ListAllInterfacesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListAllInterfacesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v1beta1.ListAllInterfacesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ListAllInterfacesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.interface_names.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v1beta1.ListAllInterfacesResponse", + len, + )?; + if !self.interface_names.is_empty() { + struct_ser.serialize_field("interfaceNames", &self.interface_names)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListAllInterfacesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["interface_names", "interfaceNames"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + InterfaceNames, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v1beta1.ListAllInterfacesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ListImplementationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.interface_name.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v1beta1.ListImplementationsRequest", + len, + )?; + if !self.interface_name.is_empty() { + struct_ser.serialize_field("interfaceName", &self.interface_name)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListImplementationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["interface_name", "interfaceName"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + InterfaceName, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v1beta1.ListImplementationsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ListImplementationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.implementation_message_names.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v1beta1.ListImplementationsResponse", + len, + )?; + if !self.implementation_message_names.is_empty() { + struct_ser.serialize_field( + "implementationMessageNames", + &self.implementation_message_names, + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListImplementationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["implementation_message_names", "implementationMessageNames"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ImplementationMessageNames, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v1beta1.ListImplementationsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs index e50492c5..14c79bd6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.rs @@ -1,5 +1,6 @@ // @generated /// AppDescriptor describes a cosmos-sdk based application +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AppDescriptor { /// AuthnDescriptor provides information on how to authenticate transactions on the application @@ -23,6 +24,7 @@ pub struct AppDescriptor { pub tx: ::core::option::Option, } /// TxDescriptor describes the accepted transaction type +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDescriptor { /// fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) @@ -36,6 +38,7 @@ pub struct TxDescriptor { } /// AuthnDescriptor provides information on how to sign transactions without relying /// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuthnDescriptor { /// sign_modes defines the supported signature algorithm @@ -46,6 +49,7 @@ pub struct AuthnDescriptor { /// NOTE(fdymylja): here we could go as far as providing an entire flow on how /// to sign a message given a SigningModeDescriptor, but it's better to think about /// this another time +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigningModeDescriptor { /// name defines the unique name of the signing mode @@ -60,6 +64,7 @@ pub struct SigningModeDescriptor { pub authn_info_provider_method_fullname: ::prost::alloc::string::String, } /// ChainDescriptor describes chain information of the application +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChainDescriptor { /// id is the chain id @@ -67,6 +72,7 @@ pub struct ChainDescriptor { pub id: ::prost::alloc::string::String, } /// CodecDescriptor describes the registered interfaces and provides metadata information on the types +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodecDescriptor { /// interfaces is a list of the registerted interfaces descriptors @@ -74,6 +80,7 @@ pub struct CodecDescriptor { pub interfaces: ::prost::alloc::vec::Vec, } /// InterfaceDescriptor describes the implementation of an interface +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceDescriptor { /// fullname is the name of the interface @@ -88,6 +95,7 @@ pub struct InterfaceDescriptor { pub interface_implementers: ::prost::alloc::vec::Vec, } /// InterfaceImplementerDescriptor describes an interface implementer +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceImplementerDescriptor { /// fullname is the protobuf queryable name of the interface implementer @@ -102,6 +110,7 @@ pub struct InterfaceImplementerDescriptor { } /// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains /// an interface represented as a google.protobuf.Any +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceAcceptingMessageDescriptor { /// fullname is the protobuf fullname of the type containing the interface @@ -114,6 +123,7 @@ pub struct InterfaceAcceptingMessageDescriptor { pub field_descriptor_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// ConfigurationDescriptor contains metadata information on the sdk.Config +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConfigurationDescriptor { /// bech32_account_address_prefix is the account address prefix @@ -121,6 +131,7 @@ pub struct ConfigurationDescriptor { pub bech32_account_address_prefix: ::prost::alloc::string::String, } /// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDescriptor { /// msg_type_url contains the TypeURL of a sdk.Msg. @@ -128,9 +139,11 @@ pub struct MsgDescriptor { pub msg_type_url: ::prost::alloc::string::String, } /// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAuthnDescriptorRequest {} /// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetAuthnDescriptorResponse { /// authn describes how to authenticate to the application when sending transactions @@ -138,9 +151,11 @@ pub struct GetAuthnDescriptorResponse { pub authn: ::core::option::Option, } /// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetChainDescriptorRequest {} /// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetChainDescriptorResponse { /// chain describes application chain information @@ -148,9 +163,11 @@ pub struct GetChainDescriptorResponse { pub chain: ::core::option::Option, } /// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetCodecDescriptorRequest {} /// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetCodecDescriptorResponse { /// codec describes the application codec such as registered interfaces and implementations @@ -158,9 +175,11 @@ pub struct GetCodecDescriptorResponse { pub codec: ::core::option::Option, } /// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetConfigurationDescriptorRequest {} /// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetConfigurationDescriptorResponse { /// config describes the application's sdk.Config @@ -168,9 +187,11 @@ pub struct GetConfigurationDescriptorResponse { pub config: ::core::option::Option, } /// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetQueryServicesDescriptorRequest {} /// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetQueryServicesDescriptorResponse { /// queries provides information on the available queryable services @@ -178,9 +199,11 @@ pub struct GetQueryServicesDescriptorResponse { pub queries: ::core::option::Option, } /// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxDescriptorRequest {} /// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxDescriptorResponse { /// tx provides information on msgs that can be forwarded to the application @@ -189,6 +212,7 @@ pub struct GetTxDescriptorResponse { pub tx: ::core::option::Option, } /// QueryServicesDescriptor contains the list of cosmos-sdk queriable services +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryServicesDescriptor { /// query_services is a list of cosmos-sdk QueryServiceDescriptor @@ -196,6 +220,7 @@ pub struct QueryServicesDescriptor { pub query_services: ::prost::alloc::vec::Vec, } /// QueryServiceDescriptor describes a cosmos-sdk queryable service +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryServiceDescriptor { /// fullname is the protobuf fullname of the service descriptor @@ -211,6 +236,7 @@ pub struct QueryServiceDescriptor { /// QueryMethodDescriptor describes a queryable method of a query service /// no other info is provided beside method name and tendermint queryable path /// because it would be redundant with the grpc reflection service +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryMethodDescriptor { /// name is the protobuf name (not fullname) of the method @@ -221,5 +247,6 @@ pub struct QueryMethodDescriptor { #[prost(string, tag = "2")] pub full_query_path: ::prost::alloc::string::String, } +include!("cosmos.base.reflection.v2alpha1.serde.rs"); include!("cosmos.base.reflection.v2alpha1.tonic.rs"); // @@protoc_insertion_point(module) 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..94f5d41c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.serde.rs @@ -0,0 +1,2875 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AppDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.authn.is_some() { + len += 1; + } + if self.chain.is_some() { + len += 1; + } + if self.codec.is_some() { + len += 1; + } + if self.configuration.is_some() { + len += 1; + } + if self.query_services.is_some() { + len += 1; + } + if self.tx.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AppDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.AppDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AuthnDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sign_modes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.reflection.v2alpha1.AuthnDescriptor", len)?; + if !self.sign_modes.is_empty() { + struct_ser.serialize_field("signModes", &self.sign_modes)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AuthnDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sign_modes", "signModes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignModes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.AuthnDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ChainDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.reflection.v2alpha1.ChainDescriptor", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ChainDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["id"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.ChainDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CodecDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.interfaces.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.reflection.v2alpha1.CodecDescriptor", len)?; + if !self.interfaces.is_empty() { + struct_ser.serialize_field("interfaces", &self.interfaces)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CodecDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["interfaces"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Interfaces, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.CodecDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ConfigurationDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.bech32_account_address_prefix.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v2alpha1.ConfigurationDescriptor", + len, + )?; + if !self.bech32_account_address_prefix.is_empty() { + struct_ser.serialize_field( + "bech32AccountAddressPrefix", + &self.bech32_account_address_prefix, + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ConfigurationDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "bech32_account_address_prefix", + "bech32AccountAddressPrefix", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bech32AccountAddressPrefix, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.ConfigurationDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetAuthnDescriptorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetAuthnDescriptorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetAuthnDescriptorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetAuthnDescriptorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.authn.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetAuthnDescriptorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authn"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authn, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetAuthnDescriptorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetChainDescriptorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetChainDescriptorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetChainDescriptorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetChainDescriptorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.chain.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetChainDescriptorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["chain"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Chain, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetChainDescriptorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetCodecDescriptorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetCodecDescriptorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetCodecDescriptorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetCodecDescriptorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.codec.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetCodecDescriptorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["codec"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Codec, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetCodecDescriptorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetConfigurationDescriptorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetConfigurationDescriptorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetConfigurationDescriptorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.config.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetConfigurationDescriptorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["config"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Config, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.reflection.v2alpha1.GetConfigurationDescriptorResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetQueryServicesDescriptorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetQueryServicesDescriptorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetQueryServicesDescriptorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.queries.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetQueryServicesDescriptorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["queries"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Queries, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.reflection.v2alpha1.GetQueryServicesDescriptorResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetTxDescriptorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetTxDescriptorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.GetTxDescriptorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetTxDescriptorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tx.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetTxDescriptorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tx"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tx, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.GetTxDescriptorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceAcceptingMessageDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fullname.is_empty() { + len += 1; + } + if !self.field_descriptor_names.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", + len, + )?; + if !self.fullname.is_empty() { + struct_ser.serialize_field("fullname", &self.fullname)?; + } + if !self.field_descriptor_names.is_empty() { + struct_ser.serialize_field("fieldDescriptorNames", &self.field_descriptor_names)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceAcceptingMessageDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["fullname", "field_descriptor_names", "fieldDescriptorNames"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fullname, + FieldDescriptorNames, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.reflection.v2alpha1.InterfaceAcceptingMessageDescriptor", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fullname.is_empty() { + len += 1; + } + if !self.interface_accepting_messages.is_empty() { + len += 1; + } + if !self.interface_implementers.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.base.reflection.v2alpha1.InterfaceDescriptor", len)?; + if !self.fullname.is_empty() { + struct_ser.serialize_field("fullname", &self.fullname)?; + } + if !self.interface_accepting_messages.is_empty() { + struct_ser.serialize_field( + "interfaceAcceptingMessages", + &self.interface_accepting_messages, + )?; + } + if !self.interface_implementers.is_empty() { + struct_ser.serialize_field("interfaceImplementers", &self.interface_implementers)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceImplementerDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fullname.is_empty() { + len += 1; + } + if !self.type_url.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", + len, + )?; + if !self.fullname.is_empty() { + struct_ser.serialize_field("fullname", &self.fullname)?; + } + if !self.type_url.is_empty() { + struct_ser.serialize_field("typeUrl", &self.type_url)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceImplementerDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["fullname", "type_url", "typeUrl"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fullname, + TypeUrl, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.reflection.v2alpha1.InterfaceImplementerDescriptor", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.msg_type_url.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.reflection.v2alpha1.MsgDescriptor", len)?; + if !self.msg_type_url.is_empty() { + struct_ser.serialize_field("msgTypeUrl", &self.msg_type_url)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["msg_type_url", "msgTypeUrl"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MsgTypeUrl, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.MsgDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryMethodDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.full_query_path.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.base.reflection.v2alpha1.QueryMethodDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.full_query_path.is_empty() { + struct_ser.serialize_field("fullQueryPath", &self.full_query_path)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryMethodDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "full_query_path", "fullQueryPath"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + FullQueryPath, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.QueryMethodDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryServiceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fullname.is_empty() { + len += 1; + } + if self.is_module { + len += 1; + } + if !self.methods.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v2alpha1.QueryServiceDescriptor", + len, + )?; + if !self.fullname.is_empty() { + struct_ser.serialize_field("fullname", &self.fullname)?; + } + if self.is_module { + struct_ser.serialize_field("isModule", &self.is_module)?; + } + if !self.methods.is_empty() { + struct_ser.serialize_field("methods", &self.methods)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryServiceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.QueryServiceDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryServicesDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.query_services.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.reflection.v2alpha1.QueryServicesDescriptor", + len, + )?; + if !self.query_services.is_empty() { + struct_ser.serialize_field("queryServices", &self.query_services)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryServicesDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["query_services", "queryServices"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + QueryServices, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.reflection.v2alpha1.QueryServicesDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SigningModeDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.number != 0 { + len += 1; + } + if !self.authn_info_provider_method_fullname.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.base.reflection.v2alpha1.SigningModeDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.number != 0 { + struct_ser.serialize_field("number", &self.number)?; + } + if !self.authn_info_provider_method_fullname.is_empty() { + struct_ser.serialize_field( + "authnInfoProviderMethodFullname", + &self.authn_info_provider_method_fullname, + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SigningModeDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.SigningModeDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TxDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fullname.is_empty() { + len += 1; + } + if !self.msgs.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.reflection.v2alpha1.TxDescriptor", len)?; + if !self.fullname.is_empty() { + struct_ser.serialize_field("fullname", &self.fullname)?; + } + if !self.msgs.is_empty() { + struct_ser.serialize_field("msgs", &self.msgs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TxDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["fullname", "msgs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fullname, + Msgs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.reflection.v2alpha1.TxDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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..a606bad5 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 @@ -1,5 +1,6 @@ // @generated /// Snapshot contains Tendermint state sync snapshot info. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Snapshot { #[prost(uint64, tag = "1")] @@ -14,6 +15,7 @@ pub struct Snapshot { pub metadata: ::core::option::Option, } /// Metadata contains SDK-specific snapshot metadata. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Metadata { /// SHA-256 chunk hashes @@ -23,6 +25,7 @@ pub struct Metadata { /// SnapshotItem is an item contained in a rootmulti.Store snapshot. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotItem { /// item is the specific type of snapshot item. @@ -32,6 +35,7 @@ pub struct SnapshotItem { /// Nested message and enum types in `SnapshotItem`. pub mod snapshot_item { /// item is the specific type of snapshot item. + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Item { #[prost(message, tag = "1")] @@ -51,6 +55,7 @@ pub mod snapshot_item { /// SnapshotStoreItem contains metadata about a snapshotted store. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotStoreItem { #[prost(string, tag = "1")] @@ -59,6 +64,7 @@ pub struct SnapshotStoreItem { /// SnapshotIAVLItem is an exported IAVL node. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotIavlItem { #[prost(bytes = "vec", tag = "1")] @@ -75,6 +81,7 @@ pub struct SnapshotIavlItem { /// SnapshotExtensionMeta contains metadata about an external snapshotter. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionMeta { #[prost(string, tag = "1")] @@ -85,6 +92,7 @@ pub struct SnapshotExtensionMeta { /// SnapshotExtensionPayload contains payloads of an external snapshotter. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionPayload { #[prost(bytes = "vec", tag = "1")] @@ -93,6 +101,7 @@ pub struct SnapshotExtensionPayload { /// SnapshotKVItem is an exported Key/Value Pair /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotKvItem { #[prost(bytes = "vec", tag = "1")] @@ -103,9 +112,11 @@ pub struct SnapshotKvItem { /// SnapshotSchema is an exported schema of smt store /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotSchema { #[prost(bytes = "vec", repeated, tag = "1")] pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } +include!("cosmos.base.snapshots.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..faddc89d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs @@ -0,0 +1,1212 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Metadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.chunk_hashes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Metadata", len)?; + if !self.chunk_hashes.is_empty() { + struct_ser.serialize_field( + "chunkHashes", + &self + .chunk_hashes + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Metadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["chunk_hashes", "chunkHashes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ChunkHashes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.Metadata") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Snapshot { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + if self.format != 0 { + len += 1; + } + if self.chunks != 0 { + len += 1; + } + if !self.hash.is_empty() { + len += 1; + } + if self.metadata.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if self.format != 0 { + struct_ser.serialize_field("format", &self.format)?; + } + if self.chunks != 0 { + struct_ser.serialize_field("chunks", &self.chunks)?; + } + if !self.hash.is_empty() { + #[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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Snapshot { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.Snapshot") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotExtensionMeta { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.format != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.format != 0 { + struct_ser.serialize_field("format", &self.format)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotExtensionMeta { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "format"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Format, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotExtensionPayload { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.payload.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", + len, + )?; + if !self.payload.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "payload", + pbjson::private::base64::encode(&self.payload).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["payload"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Payload, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotIavlItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + if self.version != 0 { + len += 1; + } + if self.height != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "value", + pbjson::private::base64::encode(&self.value).as_str(), + )?; + } + if self.version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; + } + if self.height != 0 { + struct_ser.serialize_field("height", &self.height)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotIavlItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotItem") + } + + fn visit_map(self, mut map_: V) -> std::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::<::std::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::<::std::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::<::std::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::<::std::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::<::std::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::<::std::option::Option<_>>()? + .map(snapshot_item::Item::Schema); + } + } + } + Ok(SnapshotItem { item: item__ }) + } + } + deserializer.deserialize_struct( + "cosmos.base.snapshots.v1beta1.SnapshotItem", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotKvItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "value", + pbjson::private::base64::encode(&self.value).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotKvItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotKVItem") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotSchema { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.keys.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", len)?; + if !self.keys.is_empty() { + struct_ser.serialize_field( + "keys", + &self + .keys + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotSchema { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["keys"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Keys, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotSchema") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(SnapshotSchema { + keys: keys__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.base.snapshots.v1beta1.SnapshotSchema", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SnapshotStoreItem { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SnapshotStoreItem { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotStoreItem") + } + + fn visit_map(self, mut map_: V) -> std::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..7c93c011 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 @@ -1,6 +1,7 @@ // @generated /// CommitInfo defines commit information used by the multi-store when committing /// a version/height. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitInfo { #[prost(int64, tag = "1")] @@ -10,6 +11,7 @@ pub struct CommitInfo { } /// StoreInfo defines store-specific commit information. It contains a reference /// between a store name and the commit ID. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreInfo { #[prost(string, tag = "1")] @@ -19,6 +21,7 @@ pub struct StoreInfo { } /// CommitID defines the committment information when a specific store is /// committed. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitId { #[prost(int64, tag = "1")] @@ -31,6 +34,7 @@ pub struct CommitId { /// Deletes /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreKvPair { /// the store key for the KVStore this pair originates from @@ -46,6 +50,7 @@ pub struct StoreKvPair { } /// BlockMetadata contains all the abci event data of a block /// the file streamer dump them into files together with the state changes. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockMetadata { #[prost(message, optional, tag = "1")] @@ -67,6 +72,7 @@ pub struct BlockMetadata { /// Nested message and enum types in `BlockMetadata`. pub mod block_metadata { /// DeliverTx encapulate deliver tx request and response. + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DeliverTx { #[prost(message, optional, tag = "1")] @@ -75,4 +81,5 @@ pub mod block_metadata { pub response: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseDeliverTx>, } } +include!("cosmos.base.store.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..f78ee6b3 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs @@ -0,0 +1,846 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for BlockMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.request_begin_block.is_some() { + len += 1; + } + if self.response_begin_block.is_some() { + len += 1; + } + if !self.deliver_txs.is_empty() { + len += 1; + } + if self.request_end_block.is_some() { + len += 1; + } + if self.response_end_block.is_some() { + len += 1; + } + if self.response_commit.is_some() { + 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 !self.deliver_txs.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BlockMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for block_metadata::DeliverTx { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.request.is_some() { + len += 1; + } + if self.response.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for block_metadata::DeliverTx { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["request", "response"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Request, + Response, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CommitId { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.version != 0 { + len += 1; + } + if !self.hash.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.store.v1beta1.CommitID", len)?; + if self.version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; + } + if !self.hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CommitId { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["version", "hash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + Hash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.CommitID") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CommitInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.version != 0 { + len += 1; + } + if !self.store_infos.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.store.v1beta1.CommitInfo", len)?; + if self.version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; + } + if !self.store_infos.is_empty() { + struct_ser.serialize_field("storeInfos", &self.store_infos)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CommitInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["version", "store_infos", "storeInfos"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Version, + StoreInfos, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.CommitInfo") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StoreInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.commit_id.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.store.v1beta1.StoreInfo", len)?; + if !self.name.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StoreInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "commit_id", "commitId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + CommitId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.StoreInfo") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StoreKvPair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.store_key.is_empty() { + len += 1; + } + if self.delete { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.store.v1beta1.StoreKVPair", len)?; + if !self.store_key.is_empty() { + struct_ser.serialize_field("storeKey", &self.store_key)?; + } + if self.delete { + struct_ser.serialize_field("delete", &self.delete)?; + } + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "value", + pbjson::private::base64::encode(&self.value).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StoreKvPair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.store.v1beta1.StoreKVPair") + } + + fn visit_map(self, mut map_: V) -> std::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..1b89ca89 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 @@ -1,6 +1,7 @@ // @generated /// Block is tendermint type Block, with the Header proposer address /// field converted to bech32 string. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Block { #[prost(message, optional, tag = "1")] @@ -13,6 +14,7 @@ pub struct Block { pub last_commit: ::core::option::Option<::tendermint_proto::v0_34::types::Commit>, } /// Header defines the structure of a Tendermint block header. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { /// basic block info @@ -23,7 +25,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<::tendermint_proto::google::protobuf::Timestamp>, /// prev block info #[prost(message, optional, tag = "5")] pub last_block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>, @@ -67,6 +69,7 @@ pub struct Header { } /// GetValidatorSetByHeightRequest is the request type for the /// Query/GetValidatorSetByHeight RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightRequest { #[prost(int64, tag = "1")] @@ -77,6 +80,7 @@ pub struct GetValidatorSetByHeightRequest { } /// GetValidatorSetByHeightResponse is the response type for the /// Query/GetValidatorSetByHeight RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightResponse { #[prost(int64, tag = "1")] @@ -89,6 +93,7 @@ pub struct GetValidatorSetByHeightResponse { } /// GetLatestValidatorSetRequest is the request type for the /// Query/GetValidatorSetByHeight RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetRequest { /// pagination defines an pagination for the request. @@ -97,6 +102,7 @@ pub struct GetLatestValidatorSetRequest { } /// GetLatestValidatorSetResponse is the response type for the /// Query/GetValidatorSetByHeight RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetResponse { #[prost(int64, tag = "1")] @@ -108,12 +114,13 @@ pub struct GetLatestValidatorSetResponse { pub pagination: ::core::option::Option, } /// Validator is the type for the validator-set. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub pub_key: ::core::option::Option<::prost_types::Any>, + pub pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(int64, tag = "3")] pub voting_power: i64, #[prost(int64, tag = "4")] @@ -121,6 +128,7 @@ pub struct Validator { } /// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightRequest { #[prost(int64, tag = "1")] @@ -128,6 +136,7 @@ pub struct GetBlockByHeightRequest { } /// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "1")] @@ -141,10 +150,12 @@ pub struct GetBlockByHeightResponse { } /// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockRequest {} /// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockResponse { #[prost(message, optional, tag = "1")] @@ -157,19 +168,23 @@ pub struct GetLatestBlockResponse { pub sdk_block: ::core::option::Option, } /// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSyncingRequest {} /// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSyncingResponse { #[prost(bool, tag = "1")] pub syncing: bool, } /// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoRequest {} /// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoResponse { #[prost(message, optional, tag = "1")] @@ -178,6 +193,7 @@ pub struct GetNodeInfoResponse { pub application_version: ::core::option::Option, } /// VersionInfo is the type for the GetNodeInfoResponse message. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VersionInfo { #[prost(string, tag = "1")] @@ -199,6 +215,7 @@ pub struct VersionInfo { pub cosmos_sdk_version: ::prost::alloc::string::String, } /// Module is the type for VersionInfo +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { /// module path @@ -212,6 +229,7 @@ pub struct Module { pub sum: ::prost::alloc::string::String, } /// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciQueryRequest { #[prost(bytes = "vec", tag = "1")] @@ -228,6 +246,7 @@ pub struct AbciQueryRequest { /// /// Note: This type is a duplicate of the ResponseQuery proto type defined in /// Tendermint. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciQueryResponse { #[prost(uint32, tag = "1")] @@ -257,6 +276,7 @@ pub struct AbciQueryResponse { /// /// Note: This type is a duplicate of the ProofOp proto type defined in /// Tendermint. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { #[prost(string, tag = "1")] @@ -270,10 +290,12 @@ pub struct ProofOp { /// /// Note: This type is a duplicate of the ProofOps proto type defined in /// Tendermint. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { #[prost(message, repeated, tag = "1")] pub ops: ::prost::alloc::vec::Vec, } +include!("cosmos.base.tendermint.v1beta1.serde.rs"); include!("cosmos.base.tendermint.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..4cb92e47 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.serde.rs @@ -0,0 +1,3123 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AbciQueryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + if !self.path.is_empty() { + len += 1; + } + if self.height != 0 { + len += 1; + } + if self.prove { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.ABCIQueryRequest", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if !self.path.is_empty() { + struct_ser.serialize_field("path", &self.path)?; + } + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if self.prove { + struct_ser.serialize_field("prove", &self.prove)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AbciQueryRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ABCIQueryRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AbciQueryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code != 0 { + len += 1; + } + if !self.log.is_empty() { + len += 1; + } + if !self.info.is_empty() { + len += 1; + } + if self.index != 0 { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + if self.proof_ops.is_some() { + len += 1; + } + if self.height != 0 { + len += 1; + } + if !self.codespace.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.ABCIQueryResponse", len)?; + if self.code != 0 { + struct_ser.serialize_field("code", &self.code)?; + } + if !self.log.is_empty() { + struct_ser.serialize_field("log", &self.log)?; + } + if !self.info.is_empty() { + struct_ser.serialize_field("info", &self.info)?; + } + if self.index != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; + } + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.value.is_empty() { + #[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 self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if !self.codespace.is_empty() { + struct_ser.serialize_field("codespace", &self.codespace)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AbciQueryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ABCIQueryResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Block { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.header.is_some() { + len += 1; + } + if self.data.is_some() { + len += 1; + } + if self.evidence.is_some() { + len += 1; + } + if self.last_commit.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Block { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.Block") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetBlockByHeightRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest", + len, + )?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetBlockByHeightRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetBlockByHeightResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.block_id.is_some() { + len += 1; + } + if self.block.is_some() { + len += 1; + } + if self.sdk_block.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetBlockByHeightResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetLatestBlockRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetLatestBlockRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetLatestBlockRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetLatestBlockResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.block_id.is_some() { + len += 1; + } + if self.block.is_some() { + len += 1; + } + if self.sdk_block.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetLatestBlockResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetLatestBlockResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetLatestValidatorSetRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetLatestValidatorSetRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetLatestValidatorSetResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.block_height != 0 { + len += 1; + } + if !self.validators.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", + len, + )?; + if self.block_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blockHeight", + ToString::to_string(&self.block_height).as_str(), + )?; + } + if !self.validators.is_empty() { + struct_ser.serialize_field("validators", &self.validators)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetLatestValidatorSetResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetNodeInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetNodeInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetNodeInfoRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetNodeInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.default_node_info.is_some() { + len += 1; + } + if self.application_version.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetNodeInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetNodeInfoResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetSyncingRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetSyncingRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetSyncingRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetSyncingResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.syncing { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.base.tendermint.v1beta1.GetSyncingResponse", len)?; + if self.syncing { + struct_ser.serialize_field("syncing", &self.syncing)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetSyncingResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["syncing"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Syncing, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.GetSyncingResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetValidatorSetByHeightRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", + len, + )?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetValidatorSetByHeightRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetValidatorSetByHeightResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.block_height != 0 { + len += 1; + } + if !self.validators.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", + len, + )?; + if self.block_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blockHeight", + ToString::to_string(&self.block_height).as_str(), + )?; + } + if !self.validators.is_empty() { + struct_ser.serialize_field("validators", &self.validators)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetValidatorSetByHeightResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Header { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.version.is_some() { + len += 1; + } + if !self.chain_id.is_empty() { + len += 1; + } + if self.height != 0 { + len += 1; + } + if self.time.is_some() { + len += 1; + } + if self.last_block_id.is_some() { + len += 1; + } + if !self.last_commit_hash.is_empty() { + len += 1; + } + if !self.data_hash.is_empty() { + len += 1; + } + if !self.validators_hash.is_empty() { + len += 1; + } + if !self.next_validators_hash.is_empty() { + len += 1; + } + if !self.consensus_hash.is_empty() { + len += 1; + } + if !self.app_hash.is_empty() { + len += 1; + } + if !self.last_results_hash.is_empty() { + len += 1; + } + if !self.evidence_hash.is_empty() { + len += 1; + } + if !self.proposer_address.is_empty() { + 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 !self.chain_id.is_empty() { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", 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 !self.last_commit_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "lastCommitHash", + pbjson::private::base64::encode(&self.last_commit_hash).as_str(), + )?; + } + if !self.data_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "dataHash", + pbjson::private::base64::encode(&self.data_hash).as_str(), + )?; + } + if !self.validators_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "validatorsHash", + pbjson::private::base64::encode(&self.validators_hash).as_str(), + )?; + } + if !self.next_validators_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextValidatorsHash", + pbjson::private::base64::encode(&self.next_validators_hash).as_str(), + )?; + } + if !self.consensus_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "consensusHash", + pbjson::private::base64::encode(&self.consensus_hash).as_str(), + )?; + } + if !self.app_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "appHash", + pbjson::private::base64::encode(&self.app_hash).as_str(), + )?; + } + if !self.last_results_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "lastResultsHash", + pbjson::private::base64::encode(&self.last_results_hash).as_str(), + )?; + } + if !self.evidence_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "evidenceHash", + pbjson::private::base64::encode(&self.evidence_hash).as_str(), + )?; + } + if !self.proposer_address.is_empty() { + struct_ser.serialize_field("proposerAddress", &self.proposer_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Header { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.Header") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.path.is_empty() { + len += 1; + } + if !self.version.is_empty() { + len += 1; + } + if !self.sum.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.Module", len)?; + if !self.path.is_empty() { + struct_ser.serialize_field("path", &self.path)?; + } + if !self.version.is_empty() { + struct_ser.serialize_field("version", &self.version)?; + } + if !self.sum.is_empty() { + struct_ser.serialize_field("sum", &self.sum)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["path", "version", "sum"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Version, + Sum, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.Module") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ProofOp { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.r#type.is_empty() { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.ProofOp", len)?; + if !self.r#type.is_empty() { + struct_ser.serialize_field("type", &self.r#type)?; + } + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ProofOp { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["type", "key", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Type, + Key, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ProofOp") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ProofOps { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.ops.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.ProofOps", len)?; + if !self.ops.is_empty() { + struct_ser.serialize_field("ops", &self.ops)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ProofOps { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["ops"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ops, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.ProofOps") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Validator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pub_key.is_some() { + len += 1; + } + if self.voting_power != 0 { + len += 1; + } + if self.proposer_priority != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.Validator", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pub_key.as_ref() { + struct_ser.serialize_field("pubKey", v)?; + } + if self.voting_power != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "votingPower", + ToString::to_string(&self.voting_power).as_str(), + )?; + } + if self.proposer_priority != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposerPriority", + ToString::to_string(&self.proposer_priority).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Validator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.Validator") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for VersionInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.app_name.is_empty() { + len += 1; + } + if !self.version.is_empty() { + len += 1; + } + if !self.git_commit.is_empty() { + len += 1; + } + if !self.build_tags.is_empty() { + len += 1; + } + if !self.go_version.is_empty() { + len += 1; + } + if !self.build_deps.is_empty() { + len += 1; + } + if !self.cosmos_sdk_version.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.tendermint.v1beta1.VersionInfo", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.app_name.is_empty() { + struct_ser.serialize_field("appName", &self.app_name)?; + } + if !self.version.is_empty() { + struct_ser.serialize_field("version", &self.version)?; + } + if !self.git_commit.is_empty() { + struct_ser.serialize_field("gitCommit", &self.git_commit)?; + } + if !self.build_tags.is_empty() { + struct_ser.serialize_field("buildTags", &self.build_tags)?; + } + if !self.go_version.is_empty() { + struct_ser.serialize_field("goVersion", &self.go_version)?; + } + if !self.build_deps.is_empty() { + struct_ser.serialize_field("buildDeps", &self.build_deps)?; + } + if !self.cosmos_sdk_version.is_empty() { + struct_ser.serialize_field("cosmosSdkVersion", &self.cosmos_sdk_version)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for VersionInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.tendermint.v1beta1.VersionInfo") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs index cc4421b2..8a02bbd7 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs @@ -3,6 +3,7 @@ /// /// 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")] @@ -14,6 +15,7 @@ pub struct Coin { /// /// 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")] @@ -22,15 +24,18 @@ pub struct DecCoin { 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, } +include!("cosmos.base.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..92880130 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.serde.rs @@ -0,0 +1,413 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Coin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.Coin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Coin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.Coin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecCoin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecCoin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecCoin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecCoin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.dec.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecProto", len)?; + if !self.dec.is_empty() { + struct_ser.serialize_field("dec", &self.dec)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["dec"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Dec, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecProto") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for IntProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.int.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.IntProto", len)?; + if !self.int.is_empty() { + struct_ser.serialize_field("int", &self.int)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for IntProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["int"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Int, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.IntProto") + } + + fn visit_map(self, mut map_: V) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs index b1c83050..2e2a7da7 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs @@ -1,6 +1,7 @@ // @generated /// Capability defines an implementation of an object capability. The index /// provided to a Capability must be globally unique. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Capability { #[prost(uint64, tag = "1")] @@ -8,6 +9,7 @@ pub struct Capability { } /// Owner defines a single capability owner. An owner is defined by the name of /// capability and the module name. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Owner { #[prost(string, tag = "1")] @@ -17,12 +19,14 @@ pub struct Owner { } /// CapabilityOwners defines a set of owners of a single Capability. The set of /// owners must be unique. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CapabilityOwners { #[prost(message, repeated, tag = "1")] pub owners: ::prost::alloc::vec::Vec, } /// GenesisOwners defines the capability owners with their corresponding index. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisOwners { /// index is the index of the capability owner. @@ -33,6 +37,7 @@ pub struct GenesisOwners { pub index_owners: ::core::option::Option, } /// GenesisState defines the capability module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// index is the capability global index. @@ -43,4 +48,5 @@ pub struct GenesisState { #[prost(message, repeated, tag = "2")] pub owners: ::prost::alloc::vec::Vec, } +include!("cosmos.capability.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..0ee701e3 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs @@ -0,0 +1,556 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Capability { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.index != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.capability.v1beta1.Capability", len)?; + if self.index != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Capability { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["index"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.Capability") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CapabilityOwners { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.owners.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.capability.v1beta1.CapabilityOwners", len)?; + if !self.owners.is_empty() { + struct_ser.serialize_field("owners", &self.owners)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CapabilityOwners { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["owners"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owners, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.CapabilityOwners") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisOwners { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.index != 0 { + len += 1; + } + if self.index_owners.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.capability.v1beta1.GenesisOwners", len)?; + if self.index != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisOwners { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["index", "index_owners", "indexOwners"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + IndexOwners, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.GenesisOwners") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.index != 0 { + len += 1; + } + if !self.owners.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.capability.v1beta1.GenesisState", len)?; + if self.index != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; + } + if !self.owners.is_empty() { + struct_ser.serialize_field("owners", &self.owners)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["index", "owners"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + Owners, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Owner { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.module.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.capability.v1beta1.Owner", len)?; + if !self.module.is_empty() { + struct_ser.serialize_field("module", &self.module)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Owner { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["module", "name"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Module, + Name, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.capability.v1beta1.Owner") + } + + fn visit_map(self, mut map_: V) -> std::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.crisis.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs index b26eda40..470ed705 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 @@ -1,5 +1,6 @@ // @generated /// GenesisState defines the crisis module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// constant_fee is the fee used to verify the invariant in the crisis @@ -8,6 +9,7 @@ pub struct GenesisState { pub constant_fee: ::core::option::Option, } /// MsgVerifyInvariant represents a message to verify a particular invariance. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVerifyInvariant { #[prost(string, tag = "1")] @@ -18,7 +20,9 @@ pub struct MsgVerifyInvariant { pub invariant_route: ::prost::alloc::string::String, } /// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVerifyInvariantResponse {} +include!("cosmos.crisis.v1beta1.serde.rs"); 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..3ff1baff --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.serde.rs @@ -0,0 +1,327 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.constant_fee.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["constant_fee", "constantFee"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConstantFee, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crisis.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVerifyInvariant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.invariant_module_name.is_empty() { + len += 1; + } + if !self.invariant_route.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.crisis.v1beta1.MsgVerifyInvariant", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.invariant_module_name.is_empty() { + struct_ser.serialize_field("invariantModuleName", &self.invariant_module_name)?; + } + if !self.invariant_route.is_empty() { + struct_ser.serialize_field("invariantRoute", &self.invariant_route)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVerifyInvariant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crisis.v1beta1.MsgVerifyInvariant") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVerifyInvariantResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVerifyInvariantResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crisis.v1beta1.MsgVerifyInvariantResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.crypto.ed25519.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs index 238b361a..833192d2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs @@ -4,6 +4,7 @@ /// It must not be used in a non Tendermint key context because it doesn't implement /// ADR-28. Nevertheless, you will like to use ed25519 in app user level /// then you must create a new proto message and follow ADR-28 for Address construction. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PubKey { #[prost(bytes = "vec", tag = "1")] @@ -11,9 +12,11 @@ pub struct PubKey { } /// Deprecated: PrivKey defines a ed25519 private key. /// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrivKey { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } +include!("cosmos.crypto.ed25519.serde.rs"); // @@protoc_insertion_point(module) 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..9e7f0c8e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.serde.rs @@ -0,0 +1,201 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PrivKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.ed25519.PrivKey", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PrivKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.ed25519.PrivKey") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.ed25519.PubKey", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.ed25519.PubKey") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.rs index 1ff415b4..818e4abc 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.rs @@ -1,5 +1,6 @@ // @generated /// BIP44Params is used as path field in ledger item in Record. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bip44Params { /// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation @@ -19,4 +20,5 @@ pub struct Bip44Params { #[prost(uint32, tag = "5")] pub address_index: u32, } +include!("cosmos.crypto.hd.v1.serde.rs"); // @@protoc_insertion_point(module) 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..2f8be019 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.serde.rs @@ -0,0 +1,180 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Bip44Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.purpose != 0 { + len += 1; + } + if self.coin_type != 0 { + len += 1; + } + if self.account != 0 { + len += 1; + } + if self.change { + len += 1; + } + if self.address_index != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.hd.v1.BIP44Params", len)?; + if self.purpose != 0 { + struct_ser.serialize_field("purpose", &self.purpose)?; + } + if self.coin_type != 0 { + struct_ser.serialize_field("coinType", &self.coin_type)?; + } + if self.account != 0 { + struct_ser.serialize_field("account", &self.account)?; + } + if self.change { + struct_ser.serialize_field("change", &self.change)?; + } + if self.address_index != 0 { + struct_ser.serialize_field("addressIndex", &self.address_index)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Bip44Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.hd.v1.BIP44Params") + } + + fn visit_map(self, mut map_: V) -> std::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..b267bbdb 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 @@ -1,5 +1,6 @@ // @generated /// Record is used for representing a key in the keyring. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Record { /// name represents a name of Record @@ -7,7 +8,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<::tendermint_proto::google::protobuf::Any>, /// Record contains one of the following items #[prost(oneof = "record::Item", tags = "3, 4, 5, 6")] pub item: ::core::option::Option, @@ -16,24 +17,29 @@ pub struct Record { pub mod record { /// Item is a keyring item stored in a keyring backend. /// Local item + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Local { #[prost(message, optional, tag = "1")] - pub priv_key: ::core::option::Option<::prost_types::Any>, + pub priv_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } /// Ledger item + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Ledger { #[prost(message, optional, tag = "1")] pub path: ::core::option::Option, } /// Multi item + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Multi {} /// Offline item + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Offline {} /// Record contains one of the following items + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Item { /// local stores the private key locally. @@ -50,4 +56,5 @@ pub mod record { Offline(Offline), } } +include!("cosmos.crypto.keyring.v1.serde.rs"); // @@protoc_insertion_point(module) 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..6e8dcdb7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.serde.rs @@ -0,0 +1,531 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Record { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.pub_key.is_some() { + len += 1; + } + if self.item.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.keyring.v1.Record", len)?; + if !self.name.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Record { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.keyring.v1.Record") + } + + fn visit_map(self, mut map_: V) -> std::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::<::std::option::Option<_>>()? + .map(record::Item::Local); + } + GeneratedField::Ledger => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("ledger")); + } + item__ = map_ + .next_value::<::std::option::Option<_>>()? + .map(record::Item::Ledger); + } + GeneratedField::Multi => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("multi")); + } + item__ = map_ + .next_value::<::std::option::Option<_>>()? + .map(record::Item::Multi); + } + GeneratedField::Offline => { + if item__.is_some() { + return Err(serde::de::Error::duplicate_field("offline")); + } + item__ = map_ + .next_value::<::std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for record::Ledger { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.path.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for record::Ledger { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["path"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Ledger") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for record::Local { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.priv_key.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for record::Local { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["priv_key", "privKey"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PrivKey, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Local") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for record::Multi { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for record::Multi { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Multi") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for record::Offline { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for record::Offline { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.keyring.v1.Record.Offline") + } + + fn visit_map(self, mut map_: V) -> std::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..4956c183 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 @@ -2,11 +2,13 @@ /// LegacyAminoPubKey specifies a public key type /// which nests multiple public keys and a threshold, /// it uses legacy amino address rules. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LegacyAminoPubKey { #[prost(uint32, tag = "1")] pub threshold: u32, #[prost(message, repeated, tag = "2")] - pub public_keys: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub public_keys: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, } +include!("cosmos.crypto.multisig.serde.rs"); // @@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..fc8f40bd --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.serde.rs @@ -0,0 +1,120 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for LegacyAminoPubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.threshold != 0 { + len += 1; + } + if !self.public_keys.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.crypto.multisig.LegacyAminoPubKey", len)?; + if self.threshold != 0 { + struct_ser.serialize_field("threshold", &self.threshold)?; + } + if !self.public_keys.is_empty() { + struct_ser.serialize_field("publicKeys", &self.public_keys)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for LegacyAminoPubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["threshold", "public_keys", "publicKeys"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Threshold, + PublicKeys, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.multisig.LegacyAminoPubKey") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs index 9898f38e..38dcaeb7 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.rs @@ -2,6 +2,7 @@ /// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. /// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers /// signed and with which modes. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MultiSignature { #[prost(bytes = "vec", repeated, tag = "1")] @@ -11,6 +12,7 @@ pub struct MultiSignature { /// This is used to ensure that the encoded data takes up a minimal amount of /// space after proto encoding. /// This is not thread safe, and is not intended for concurrent usage. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompactBitArray { #[prost(uint32, tag = "1")] @@ -18,4 +20,5 @@ pub struct CompactBitArray { #[prost(bytes = "vec", tag = "2")] pub elems: ::prost::alloc::vec::Vec, } +include!("cosmos.crypto.multisig.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..710a19db --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.multisig.v1beta1.serde.rs @@ -0,0 +1,241 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for CompactBitArray { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.extra_bits_stored != 0 { + len += 1; + } + if !self.elems.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.crypto.multisig.v1beta1.CompactBitArray", len)?; + if self.extra_bits_stored != 0 { + struct_ser.serialize_field("extraBitsStored", &self.extra_bits_stored)?; + } + if !self.elems.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "elems", + pbjson::private::base64::encode(&self.elems).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CompactBitArray { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["extra_bits_stored", "extraBitsStored", "elems"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ExtraBitsStored, + Elems, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.multisig.v1beta1.CompactBitArray") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MultiSignature { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signatures.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.crypto.multisig.v1beta1.MultiSignature", len)?; + if !self.signatures.is_empty() { + struct_ser.serialize_field( + "signatures", + &self + .signatures + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MultiSignature { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signatures"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signatures, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.multisig.v1beta1.MultiSignature") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.rs index 1f145b3c..bc3e9ac2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.rs @@ -4,15 +4,18 @@ /// if the y-coordinate is the lexicographically largest of the two associated with /// the x-coordinate. Otherwise the first byte is a 0x03. /// This prefix is followed with the x-coordinate. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PubKey { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } /// PrivKey defines a secp256k1 private key. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrivKey { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } +include!("cosmos.crypto.secp256k1.serde.rs"); // @@protoc_insertion_point(module) 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..d86db770 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256k1.serde.rs @@ -0,0 +1,201 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PrivKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256k1.PrivKey", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PrivKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256k1.PrivKey") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256k1.PubKey", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256k1.PubKey") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.rs index ec7fc762..23cc50dc 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.rs @@ -1,5 +1,6 @@ // @generated /// PubKey defines a secp256r1 ECDSA public key. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PubKey { /// Point on secp256r1 curve in a compressed representation as specified in section @@ -8,10 +9,12 @@ pub struct PubKey { pub key: ::prost::alloc::vec::Vec, } /// PrivKey defines a secp256r1 ECDSA private key. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrivKey { /// secret number serialized using big-endian encoding #[prost(bytes = "vec", tag = "1")] pub secret: ::prost::alloc::vec::Vec, } +include!("cosmos.crypto.secp256r1.serde.rs"); // @@protoc_insertion_point(module) 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..f209b80d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.secp256r1.serde.rs @@ -0,0 +1,203 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PrivKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.secret.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256r1.PrivKey", len)?; + if !self.secret.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "secret", + pbjson::private::base64::encode(&self.secret).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PrivKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["secret"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Secret, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256r1.PrivKey") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PubKey { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.crypto.secp256r1.PubKey", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PubKey { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.crypto.secp256r1.PubKey") + } + + fn visit_map(self, mut map_: V) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs index 85d64736..9cbfccb6 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 @@ -1,5 +1,6 @@ // @generated /// Params defines the set of params for the distribution module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { #[prost(string, tag = "1")] @@ -23,6 +24,7 @@ pub struct Params { /// + number of slashes which ended the associated period (and might need to /// read that record) /// + one per validator for the zeroeth period, set on initialization +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorHistoricalRewards { #[prost(message, repeated, tag = "1")] @@ -33,6 +35,7 @@ pub struct ValidatorHistoricalRewards { /// ValidatorCurrentRewards represents current rewards and current /// period for a validator kept as a running counter and incremented /// each block as long as the validator's tokens remain constant. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorCurrentRewards { #[prost(message, repeated, tag = "1")] @@ -42,6 +45,7 @@ pub struct ValidatorCurrentRewards { } /// ValidatorAccumulatedCommission represents accumulated commission /// for a validator kept as a running counter, can be withdrawn at any time. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorAccumulatedCommission { #[prost(message, repeated, tag = "1")] @@ -49,6 +53,7 @@ pub struct ValidatorAccumulatedCommission { } /// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards /// for a validator inexpensive to track, allows simple sanity checks. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorOutstandingRewards { #[prost(message, repeated, tag = "1")] @@ -58,6 +63,7 @@ pub struct ValidatorOutstandingRewards { /// Height is implicit within the store key. /// This is needed to calculate appropriate amount of staking tokens /// for delegations which are withdrawn after a slash has occurred. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEvent { #[prost(uint64, tag = "1")] @@ -66,12 +72,14 @@ pub struct ValidatorSlashEvent { pub fraction: ::prost::alloc::string::String, } /// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEvents { #[prost(message, repeated, tag = "1")] pub validator_slash_events: ::prost::alloc::vec::Vec, } /// FeePool is the global fee pool for distribution. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FeePool { #[prost(message, repeated, tag = "1")] @@ -80,6 +88,7 @@ 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. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposal { #[prost(string, tag = "1")] @@ -97,6 +106,7 @@ pub struct CommunityPoolSpendProposal { /// occurred). NOTE: Even though validators are slashed to whole staking tokens, /// the delegators within the validator may be left with less than a full token, /// thus sdk.Dec is used. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorStartingInfo { #[prost(uint64, tag = "1")] @@ -108,6 +118,7 @@ pub struct DelegatorStartingInfo { } /// DelegationDelegatorReward represents the properties /// of a delegator's delegation reward. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationDelegatorReward { #[prost(string, tag = "1")] @@ -117,6 +128,7 @@ pub struct DelegationDelegatorReward { } /// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal /// with a deposit +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommunityPoolSpendProposalWithDeposit { #[prost(string, tag = "1")] @@ -133,6 +145,7 @@ pub struct CommunityPoolSpendProposalWithDeposit { /// DelegatorWithdrawInfo is the address for where distributions rewards are /// withdrawn to by default this struct is only used at genesis to feed in /// default withdraw addresses. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorWithdrawInfo { /// delegator_address is the address of the delegator. @@ -143,6 +156,7 @@ pub struct DelegatorWithdrawInfo { pub withdraw_address: ::prost::alloc::string::String, } /// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorOutstandingRewardsRecord { /// validator_address is the address of the validator. @@ -154,6 +168,7 @@ pub struct ValidatorOutstandingRewardsRecord { } /// ValidatorAccumulatedCommissionRecord is used for import / export via genesis /// json. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorAccumulatedCommissionRecord { /// validator_address is the address of the validator. @@ -165,6 +180,7 @@ pub struct ValidatorAccumulatedCommissionRecord { } /// ValidatorHistoricalRewardsRecord is used for import / export via genesis /// json. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorHistoricalRewardsRecord { /// validator_address is the address of the validator. @@ -178,6 +194,7 @@ pub struct ValidatorHistoricalRewardsRecord { pub rewards: ::core::option::Option, } /// ValidatorCurrentRewardsRecord is used for import / export via genesis json. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorCurrentRewardsRecord { /// validator_address is the address of the validator. @@ -188,6 +205,7 @@ pub struct ValidatorCurrentRewardsRecord { pub rewards: ::core::option::Option, } /// DelegatorStartingInfoRecord used for import / export via genesis json. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegatorStartingInfoRecord { /// delegator_address is the address of the delegator. @@ -201,6 +219,7 @@ pub struct DelegatorStartingInfoRecord { pub starting_info: ::core::option::Option, } /// ValidatorSlashEventRecord is used for import / export via genesis json. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSlashEventRecord { /// validator_address is the address of the validator. @@ -217,6 +236,7 @@ pub struct ValidatorSlashEventRecord { pub validator_slash_event: ::core::option::Option, } /// GenesisState defines the distribution module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the paramaters of the module. @@ -252,9 +272,11 @@ pub struct GenesisState { pub validator_slash_events: ::prost::alloc::vec::Vec, } /// 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. @@ -263,6 +285,7 @@ pub struct QueryParamsResponse { } /// QueryValidatorOutstandingRewardsRequest is the request type for the /// Query/ValidatorOutstandingRewards RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorOutstandingRewardsRequest { /// validator_address defines the validator address to query for. @@ -271,6 +294,7 @@ pub struct QueryValidatorOutstandingRewardsRequest { } /// QueryValidatorOutstandingRewardsResponse is the response type for the /// Query/ValidatorOutstandingRewards RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorOutstandingRewardsResponse { #[prost(message, optional, tag = "1")] @@ -278,6 +302,7 @@ pub struct QueryValidatorOutstandingRewardsResponse { } /// QueryValidatorCommissionRequest is the request type for the /// Query/ValidatorCommission RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionRequest { /// validator_address defines the validator address to query for. @@ -286,6 +311,7 @@ pub struct QueryValidatorCommissionRequest { } /// QueryValidatorCommissionResponse is the response type for the /// Query/ValidatorCommission RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorCommissionResponse { /// commission defines the commision the validator received. @@ -294,6 +320,7 @@ pub struct QueryValidatorCommissionResponse { } /// QueryValidatorSlashesRequest is the request type for the /// Query/ValidatorSlashes RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorSlashesRequest { /// validator_address defines the validator address to query for. @@ -311,6 +338,7 @@ pub struct QueryValidatorSlashesRequest { } /// QueryValidatorSlashesResponse is the response type for the /// Query/ValidatorSlashes RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorSlashesResponse { /// slashes defines the slashes the validator received. @@ -322,6 +350,7 @@ pub struct QueryValidatorSlashesResponse { } /// QueryDelegationRewardsRequest is the request type for the /// Query/DelegationRewards RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRewardsRequest { /// delegator_address defines the delegator address to query for. @@ -333,6 +362,7 @@ pub struct QueryDelegationRewardsRequest { } /// QueryDelegationRewardsResponse is the response type for the /// Query/DelegationRewards RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRewardsResponse { /// rewards defines the rewards accrued by a delegation. @@ -341,6 +371,7 @@ pub struct QueryDelegationRewardsResponse { } /// QueryDelegationTotalRewardsRequest is the request type for the /// Query/DelegationTotalRewards RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationTotalRewardsRequest { /// delegator_address defines the delegator address to query for. @@ -349,6 +380,7 @@ pub struct QueryDelegationTotalRewardsRequest { } /// QueryDelegationTotalRewardsResponse is the response type for the /// Query/DelegationTotalRewards RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationTotalRewardsResponse { /// rewards defines all the rewards accrued by a delegator. @@ -360,6 +392,7 @@ pub struct QueryDelegationTotalRewardsResponse { } /// QueryDelegatorValidatorsRequest is the request type for the /// Query/DelegatorValidators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsRequest { /// delegator_address defines the delegator address to query for. @@ -368,6 +401,7 @@ pub struct QueryDelegatorValidatorsRequest { } /// QueryDelegatorValidatorsResponse is the response type for the /// Query/DelegatorValidators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { /// validators defines the validators a delegator is delegating for. @@ -376,6 +410,7 @@ pub struct QueryDelegatorValidatorsResponse { } /// QueryDelegatorWithdrawAddressRequest is the request type for the /// Query/DelegatorWithdrawAddress RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorWithdrawAddressRequest { /// delegator_address defines the delegator address to query for. @@ -384,6 +419,7 @@ pub struct QueryDelegatorWithdrawAddressRequest { } /// QueryDelegatorWithdrawAddressResponse is the response type for the /// Query/DelegatorWithdrawAddress RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorWithdrawAddressResponse { /// withdraw_address defines the delegator address to query for. @@ -392,10 +428,12 @@ pub struct QueryDelegatorWithdrawAddressResponse { } /// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCommunityPoolRequest {} /// QueryCommunityPoolResponse is the response type for the Query/CommunityPool /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCommunityPoolResponse { /// pool defines community pool's coins. @@ -404,6 +442,7 @@ pub struct QueryCommunityPoolResponse { } /// MsgSetWithdrawAddress sets the withdraw address for /// a delegator (or validator self-delegation). +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddress { #[prost(string, tag = "1")] @@ -412,10 +451,12 @@ pub struct MsgSetWithdrawAddress { pub withdraw_address: ::prost::alloc::string::String, } /// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetWithdrawAddressResponse {} /// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator /// from a single validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorReward { #[prost(string, tag = "1")] @@ -424,6 +465,7 @@ pub struct MsgWithdrawDelegatorReward { pub validator_address: ::prost::alloc::string::String, } /// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorRewardResponse { /// Since: cosmos-sdk 0.46 @@ -432,12 +474,14 @@ pub struct MsgWithdrawDelegatorRewardResponse { } /// MsgWithdrawValidatorCommission withdraws the full commission to the validator /// address. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommission { #[prost(string, tag = "1")] pub validator_address: ::prost::alloc::string::String, } /// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommissionResponse { /// Since: cosmos-sdk 0.46 @@ -446,6 +490,7 @@ pub struct MsgWithdrawValidatorCommissionResponse { } /// MsgFundCommunityPool allows an account to directly /// fund the community pool. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPool { #[prost(message, repeated, tag = "1")] @@ -454,7 +499,9 @@ pub struct MsgFundCommunityPool { pub depositor: ::prost::alloc::string::String, } /// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgFundCommunityPoolResponse {} +include!("cosmos.distribution.v1beta1.serde.rs"); 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..72437a02 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs @@ -0,0 +1,5712 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for CommunityPoolSpendProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.recipient.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.CommunityPoolSpendProposal", + len, + )?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CommunityPoolSpendProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.CommunityPoolSpendProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CommunityPoolSpendProposalWithDeposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.recipient.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + if !self.deposit.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + len, + )?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + if !self.deposit.is_empty() { + struct_ser.serialize_field("deposit", &self.deposit)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CommunityPoolSpendProposalWithDeposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DelegationDelegatorReward { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if !self.reward.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.distribution.v1beta1.DelegationDelegatorReward", len)?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if !self.reward.is_empty() { + struct_ser.serialize_field("reward", &self.reward)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DelegationDelegatorReward { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_address", "validatorAddress", "reward"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Reward, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegationDelegatorReward") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DelegatorStartingInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.previous_period != 0 { + len += 1; + } + if !self.stake.is_empty() { + len += 1; + } + if self.height != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.distribution.v1beta1.DelegatorStartingInfo", len)?; + if self.previous_period != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "previousPeriod", + ToString::to_string(&self.previous_period).as_str(), + )?; + } + if !self.stake.is_empty() { + struct_ser.serialize_field("stake", &self.stake)?; + } + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DelegatorStartingInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegatorStartingInfo") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DelegatorStartingInfoRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if self.starting_info.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.DelegatorStartingInfoRecord", + len, + )?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DelegatorStartingInfoRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.DelegatorStartingInfoRecord") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DelegatorWithdrawInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.withdraw_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.distribution.v1beta1.DelegatorWithdrawInfo", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.withdraw_address.is_empty() { + struct_ser.serialize_field("withdrawAddress", &self.withdraw_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DelegatorWithdrawInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.DelegatorWithdrawInfo") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for FeePool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.community_pool.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.distribution.v1beta1.FeePool", len)?; + if !self.community_pool.is_empty() { + struct_ser.serialize_field("communityPool", &self.community_pool)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for FeePool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["community_pool", "communityPool"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CommunityPool, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.FeePool") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if self.fee_pool.is_some() { + len += 1; + } + if !self.delegator_withdraw_infos.is_empty() { + len += 1; + } + if !self.previous_proposer.is_empty() { + len += 1; + } + if !self.outstanding_rewards.is_empty() { + len += 1; + } + if !self.validator_accumulated_commissions.is_empty() { + len += 1; + } + if !self.validator_historical_rewards.is_empty() { + len += 1; + } + if !self.validator_current_rewards.is_empty() { + len += 1; + } + if !self.delegator_starting_infos.is_empty() { + len += 1; + } + if !self.validator_slash_events.is_empty() { + 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 !self.delegator_withdraw_infos.is_empty() { + struct_ser.serialize_field("delegatorWithdrawInfos", &self.delegator_withdraw_infos)?; + } + if !self.previous_proposer.is_empty() { + struct_ser.serialize_field("previousProposer", &self.previous_proposer)?; + } + if !self.outstanding_rewards.is_empty() { + struct_ser.serialize_field("outstandingRewards", &self.outstanding_rewards)?; + } + if !self.validator_accumulated_commissions.is_empty() { + struct_ser.serialize_field( + "validatorAccumulatedCommissions", + &self.validator_accumulated_commissions, + )?; + } + if !self.validator_historical_rewards.is_empty() { + struct_ser.serialize_field( + "validatorHistoricalRewards", + &self.validator_historical_rewards, + )?; + } + if !self.validator_current_rewards.is_empty() { + struct_ser + .serialize_field("validatorCurrentRewards", &self.validator_current_rewards)?; + } + if !self.delegator_starting_infos.is_empty() { + struct_ser.serialize_field("delegatorStartingInfos", &self.delegator_starting_infos)?; + } + if !self.validator_slash_events.is_empty() { + struct_ser.serialize_field("validatorSlashEvents", &self.validator_slash_events)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgFundCommunityPool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.amount.is_empty() { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.distribution.v1beta1.MsgFundCommunityPool", len)?; + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgFundCommunityPool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount", "depositor"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + Depositor, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgFundCommunityPool") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgFundCommunityPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgFundCommunityPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSetWithdrawAddress { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.withdraw_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.distribution.v1beta1.MsgSetWithdrawAddress", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.withdraw_address.is_empty() { + struct_ser.serialize_field("withdrawAddress", &self.withdraw_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSetWithdrawAddress { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgSetWithdrawAddress") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSetWithdrawAddressResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSetWithdrawAddressResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgWithdrawDelegatorReward { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", + len, + )?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgWithdrawDelegatorReward { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgWithdrawDelegatorRewardResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + len, + )?; + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgWithdrawDelegatorRewardResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgWithdrawValidatorCommission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", + len, + )?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgWithdrawValidatorCommission { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_address", "validatorAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgWithdrawValidatorCommissionResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + len, + )?; + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgWithdrawValidatorCommissionResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.community_tax.is_empty() { + len += 1; + } + if !self.base_proposer_reward.is_empty() { + len += 1; + } + if !self.bonus_proposer_reward.is_empty() { + len += 1; + } + if self.withdraw_addr_enabled { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.distribution.v1beta1.Params", len)?; + if !self.community_tax.is_empty() { + struct_ser.serialize_field("communityTax", &self.community_tax)?; + } + if !self.base_proposer_reward.is_empty() { + struct_ser.serialize_field("baseProposerReward", &self.base_proposer_reward)?; + } + if !self.bonus_proposer_reward.is_empty() { + struct_ser.serialize_field("bonusProposerReward", &self.bonus_proposer_reward)?; + } + if self.withdraw_addr_enabled { + struct_ser.serialize_field("withdrawAddrEnabled", &self.withdraw_addr_enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCommunityPoolRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCommunityPoolRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryCommunityPoolRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCommunityPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.pool.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryCommunityPoolResponse", + len, + )?; + if !self.pool.is_empty() { + struct_ser.serialize_field("pool", &self.pool)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCommunityPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pool"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pool, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryCommunityPoolResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegationRewardsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegationRewardsRequest", + len, + )?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegationRewardsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.QueryDelegationRewardsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegationRewardsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.rewards.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegationRewardsResponse", + len, + )?; + if !self.rewards.is_empty() { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegationRewardsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["rewards"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.QueryDelegationRewardsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegationTotalRewardsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", + len, + )?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegationTotalRewardsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegator_address", "delegatorAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegationTotalRewardsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.rewards.is_empty() { + len += 1; + } + if !self.total.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", + len, + )?; + if !self.rewards.is_empty() { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + if !self.total.is_empty() { + struct_ser.serialize_field("total", &self.total)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegationTotalRewardsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["rewards", "total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorValidatorsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest", + len, + )?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegator_address", "delegatorAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorValidatorsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validators.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", + len, + )?; + if !self.validators.is_empty() { + struct_ser.serialize_field("validators", &self.validators)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validators"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validators, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorWithdrawAddressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", + len, + )?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorWithdrawAddressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegator_address", "delegatorAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorWithdrawAddressResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.withdraw_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", + len, + )?; + if !self.withdraw_address.is_empty() { + struct_ser.serialize_field("withdrawAddress", &self.withdraw_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorWithdrawAddressResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["withdraw_address", "withdrawAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + WithdrawAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorCommissionRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryValidatorCommissionRequest", + len, + )?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorCommissionRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_address", "validatorAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.QueryValidatorCommissionRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorCommissionResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.commission.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorCommissionResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["commission"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commission, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryValidatorCommissionResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorOutstandingRewardsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", + len, + )?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorOutstandingRewardsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_address", "validatorAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorOutstandingRewardsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.rewards.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorOutstandingRewardsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["rewards"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorSlashesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if self.starting_height != 0 { + len += 1; + } + if self.ending_height != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryValidatorSlashesRequest", + len, + )?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if self.starting_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "startingHeight", + ToString::to_string(&self.starting_height).as_str(), + )?; + } + if self.ending_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "endingHeight", + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorSlashesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.QueryValidatorSlashesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorSlashesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.slashes.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.QueryValidatorSlashesResponse", + len, + )?; + if !self.slashes.is_empty() { + struct_ser.serialize_field("slashes", &self.slashes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorSlashesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["slashes", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Slashes, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.QueryValidatorSlashesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorAccumulatedCommission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.commission.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorAccumulatedCommission", + len, + )?; + if !self.commission.is_empty() { + struct_ser.serialize_field("commission", &self.commission)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorAccumulatedCommission { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["commission"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commission, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.ValidatorAccumulatedCommission") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorAccumulatedCommissionRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if self.accumulated.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", + len, + )?; + if !self.validator_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorAccumulatedCommissionRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_address", "validatorAddress", "accumulated"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Accumulated, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorCurrentRewards { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.rewards.is_empty() { + len += 1; + } + if self.period != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.distribution.v1beta1.ValidatorCurrentRewards", len)?; + if !self.rewards.is_empty() { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + if self.period != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("period", ToString::to_string(&self.period).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorCurrentRewards { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["rewards", "period"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + Period, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorCurrentRewards") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorCurrentRewardsRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if self.rewards.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord", + len, + )?; + if !self.validator_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorCurrentRewardsRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_address", "validatorAddress", "rewards"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddress, + Rewards, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorHistoricalRewards { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.cumulative_reward_ratio.is_empty() { + len += 1; + } + if self.reference_count != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorHistoricalRewards", + len, + )?; + if !self.cumulative_reward_ratio.is_empty() { + struct_ser.serialize_field("cumulativeRewardRatio", &self.cumulative_reward_ratio)?; + } + if self.reference_count != 0 { + struct_ser.serialize_field("referenceCount", &self.reference_count)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorHistoricalRewards { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorHistoricalRewards") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorHistoricalRewardsRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if self.period != 0 { + len += 1; + } + if self.rewards.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", + len, + )?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if self.period != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("period", ToString::to_string(&self.period).as_str())?; + } + if let Some(v) = self.rewards.as_ref() { + struct_ser.serialize_field("rewards", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorHistoricalRewardsRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorOutstandingRewards { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.rewards.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorOutstandingRewards", + len, + )?; + if !self.rewards.is_empty() { + struct_ser.serialize_field("rewards", &self.rewards)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorOutstandingRewards { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["rewards"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Rewards, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.ValidatorOutstandingRewards") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorOutstandingRewardsRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if !self.outstanding_rewards.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", + len, + )?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if !self.outstanding_rewards.is_empty() { + struct_ser.serialize_field("outstandingRewards", &self.outstanding_rewards)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorOutstandingRewardsRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorSlashEvent { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.validator_period != 0 { + len += 1; + } + if !self.fraction.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEvent", len)?; + if self.validator_period != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "validatorPeriod", + ToString::to_string(&self.validator_period).as_str(), + )?; + } + if !self.fraction.is_empty() { + struct_ser.serialize_field("fraction", &self.fraction)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorSlashEvent { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_period", "validatorPeriod", "fraction"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorPeriod, + Fraction, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorSlashEvent") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorSlashEventRecord { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_address.is_empty() { + len += 1; + } + if self.height != 0 { + len += 1; + } + if self.period != 0 { + len += 1; + } + if self.validator_slash_event.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEventRecord", len)?; + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if self.period != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("period", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorSlashEventRecord { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorSlashEventRecord") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorSlashEvents { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_slash_events.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.distribution.v1beta1.ValidatorSlashEvents", len)?; + if !self.validator_slash_events.is_empty() { + struct_ser.serialize_field("validatorSlashEvents", &self.validator_slash_events)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorSlashEvents { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_slash_events", "validatorSlashEvents"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorSlashEvents, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.distribution.v1beta1.ValidatorSlashEvents") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.evidence.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs index 6ef949d0..a5e7f155 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 @@ -1,25 +1,28 @@ // @generated /// Equivocation implements the Evidence interface and defines evidence of double /// signing misbehavior. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Equivocation { #[prost(int64, tag = "1")] pub height: i64, #[prost(message, optional, tag = "2")] - pub time: ::core::option::Option<::prost_types::Timestamp>, + pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(int64, tag = "3")] pub power: i64, #[prost(string, tag = "4")] pub consensus_address: ::prost::alloc::string::String, } /// GenesisState defines the evidence module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] 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<::tendermint_proto::google::protobuf::Any>, } /// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceRequest { /// evidence_hash defines the hash of the requested evidence. @@ -27,14 +30,16 @@ pub struct QueryEvidenceRequest { pub evidence_hash: ::prost::alloc::vec::Vec, } /// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[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<::tendermint_proto::google::protobuf::Any>, } /// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllEvidenceRequest { /// pagination defines an optional pagination for the request. @@ -43,30 +48,34 @@ pub struct QueryAllEvidenceRequest { } /// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] 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<::tendermint_proto::google::protobuf::Any>, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// MsgSubmitEvidence represents a message that supports submitting arbitrary /// Evidence of misbehavior such as equivocation or counterfactual signing. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidence { #[prost(string, tag = "1")] pub submitter: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] - pub evidence: ::core::option::Option<::prost_types::Any>, + pub evidence: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } /// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidenceResponse { /// hash defines the hash of the evidence. #[prost(bytes = "vec", tag = "4")] pub hash: ::prost::alloc::vec::Vec, } +include!("cosmos.evidence.v1beta1.serde.rs"); include!("cosmos.evidence.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..356b819f --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.serde.rs @@ -0,0 +1,924 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Equivocation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + if self.time.is_some() { + len += 1; + } + if self.power != 0 { + len += 1; + } + if !self.consensus_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.evidence.v1beta1.Equivocation", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.time.as_ref() { + struct_ser.serialize_field("time", v)?; + } + if self.power != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("power", ToString::to_string(&self.power).as_str())?; + } + if !self.consensus_address.is_empty() { + struct_ser.serialize_field("consensusAddress", &self.consensus_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Equivocation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.Equivocation") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.evidence.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.evidence.v1beta1.GenesisState", len)?; + if !self.evidence.is_empty() { + struct_ser.serialize_field("evidence", &self.evidence)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["evidence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Evidence, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitEvidence { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.submitter.is_empty() { + len += 1; + } + if self.evidence.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.evidence.v1beta1.MsgSubmitEvidence", len)?; + if !self.submitter.is_empty() { + struct_ser.serialize_field("submitter", &self.submitter)?; + } + if let Some(v) = self.evidence.as_ref() { + struct_ser.serialize_field("evidence", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitEvidence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["submitter", "evidence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Submitter, + Evidence, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.MsgSubmitEvidence") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitEvidenceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.hash.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse", len)?; + if !self.hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitEvidenceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["hash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Hash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllEvidenceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllEvidenceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryAllEvidenceRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllEvidenceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.evidence.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.evidence.v1beta1.QueryAllEvidenceResponse", len)?; + if !self.evidence.is_empty() { + struct_ser.serialize_field("evidence", &self.evidence)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllEvidenceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["evidence", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Evidence, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryAllEvidenceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryEvidenceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.evidence_hash.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.evidence.v1beta1.QueryEvidenceRequest", len)?; + if !self.evidence_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "evidenceHash", + pbjson::private::base64::encode(&self.evidence_hash).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryEvidenceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["evidence_hash", "evidenceHash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EvidenceHash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "evidenceHash" | "evidence_hash" => Ok(GeneratedField::EvidenceHash), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryEvidenceRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut evidence_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, + ); + } + } + } + Ok(QueryEvidenceRequest { + evidence_hash: evidence_hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.evidence.v1beta1.QueryEvidenceRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryEvidenceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.evidence.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryEvidenceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["evidence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Evidence, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.evidence.v1beta1.QueryEvidenceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs index 6715da41..900fb480 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 @@ -1,6 +1,7 @@ // @generated /// BasicAllowance implements Allowance with a one-time grant of coins /// that optionally expires. The grantee can use up to SpendLimit to cover fees. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BasicAllowance { /// spend_limit specifies the maximum amount of coins that can be spent @@ -10,10 +11,11 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, } /// PeriodicAllowance extends Allowance to allow for both a maximum cap, /// as well as a limit per time period. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeriodicAllowance { /// basic specifies a struct of `BasicAllowance` @@ -22,7 +24,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<::tendermint_proto::google::protobuf::Duration>, /// period_spend_limit specifies the maximum number of coins that can be spent /// in the period #[prost(message, repeated, tag = "3")] @@ -34,19 +36,21 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, } /// AllowedMsgAllowance creates allowance only for specified message types. +#[allow(clippy::derive_partial_eq_without_eq)] #[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<::tendermint_proto::google::protobuf::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>, } /// Grant is stored in the KVStore to record a grant with full context +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Grant { /// granter is the address of the user granting an allowance of their funds. @@ -57,15 +61,17 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// GenesisState contains a set of fee allowances, persisted from the store +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] pub allowances: ::prost::alloc::vec::Vec, } /// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowanceRequest { /// granter is the address of the user granting an allowance of their funds. @@ -76,6 +82,7 @@ pub struct QueryAllowanceRequest { pub grantee: ::prost::alloc::string::String, } /// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowanceResponse { /// allowance is a allowance granted for grantee by granter. @@ -83,6 +90,7 @@ pub struct QueryAllowanceResponse { pub allowance: ::core::option::Option, } /// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesRequest { #[prost(string, tag = "1")] @@ -92,6 +100,7 @@ pub struct QueryAllowancesRequest { pub pagination: ::core::option::Option, } /// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesResponse { /// allowances are allowance's granted for grantee by granter. @@ -104,6 +113,7 @@ pub struct QueryAllowancesResponse { /// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesByGranterRequest { #[prost(string, tag = "1")] @@ -115,6 +125,7 @@ pub struct QueryAllowancesByGranterRequest { /// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesByGranterResponse { /// allowances that have been issued by the granter. @@ -126,6 +137,7 @@ pub struct QueryAllowancesByGranterResponse { } /// MsgGrantAllowance adds permission for Grantee to spend up to Allowance /// of fees from the account of Granter. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantAllowance { /// granter is the address of the user granting an allowance of their funds. @@ -136,12 +148,14 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantAllowanceResponse {} /// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeAllowance { /// granter is the address of the user granting an allowance of their funds. @@ -152,7 +166,9 @@ pub struct MsgRevokeAllowance { pub grantee: ::prost::alloc::string::String, } /// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeAllowanceResponse {} +include!("cosmos.feegrant.v1beta1.serde.rs"); include!("cosmos.feegrant.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..1d1bcf08 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs @@ -0,0 +1,1755 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AllowedMsgAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.allowance.is_some() { + len += 1; + } + if !self.allowed_messages.is_empty() { + 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 !self.allowed_messages.is_empty() { + struct_ser.serialize_field("allowedMessages", &self.allowed_messages)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AllowedMsgAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowance", "allowed_messages", "allowedMessages"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowance, + AllowedMessages, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.AllowedMsgAllowance") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for BasicAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.spend_limit.is_empty() { + len += 1; + } + if self.expiration.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.BasicAllowance", len)?; + if !self.spend_limit.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BasicAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["spend_limit", "spendLimit", "expiration"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SpendLimit, + Expiration, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.BasicAllowance") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.allowances.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.GenesisState", len)?; + if !self.allowances.is_empty() { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowances"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Grant { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if self.allowance.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.feegrant.v1beta1.Grant", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Grant { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "grantee", "allowance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Allowance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.Grant") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgGrantAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if self.allowance.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.MsgGrantAllowance", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgGrantAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "grantee", "allowance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Allowance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgGrantAllowance") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgGrantAllowanceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgGrantAllowanceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgRevokeAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.MsgRevokeAllowance", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgRevokeAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "grantee"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgRevokeAllowance") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgRevokeAllowanceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgRevokeAllowanceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PeriodicAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.basic.is_some() { + len += 1; + } + if self.period.is_some() { + len += 1; + } + if !self.period_spend_limit.is_empty() { + len += 1; + } + if !self.period_can_spend.is_empty() { + len += 1; + } + if self.period_reset.is_some() { + 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 !self.period_spend_limit.is_empty() { + struct_ser.serialize_field("periodSpendLimit", &self.period_spend_limit)?; + } + if !self.period_can_spend.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PeriodicAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.PeriodicAllowance") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllowanceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowanceRequest", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllowanceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "grantee"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowanceRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllowanceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.allowance.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllowanceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowanceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllowancesByGranterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest", + len, + )?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllowancesByGranterRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllowancesByGranterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.allowances.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse", + len, + )?; + if !self.allowances.is_empty() { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllowancesByGranterResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowances", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllowancesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.grantee.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesRequest", len)?; + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllowancesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["grantee", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Grantee, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllowancesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.allowances.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.QueryAllowancesResponse", len)?; + if !self.allowances.is_empty() { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllowancesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowances", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.QueryAllowancesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.rs index 2527f9e4..5be93326 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.rs @@ -1,9 +1,11 @@ // @generated /// GenesisState defines the raw genesis transaction in JSON. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// gen_txs defines the genesis transactions. #[prost(bytes = "vec", repeated, tag = "1")] pub gen_txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } +include!("cosmos.genutil.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..b4ba04e5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.genutil.v1beta1.serde.rs @@ -0,0 +1,113 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.gen_txs.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.genutil.v1beta1.GenesisState", len)?; + if !self.gen_txs.is_empty() { + struct_ser.serialize_field( + "genTxs", + &self + .gen_txs + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["gen_txs", "genTxs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GenTxs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.genutil.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs index 97baf541..c83db60b 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 @@ -1,5 +1,6 @@ // @generated /// WeightedVoteOption defines a unit of vote for vote split. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { #[prost(enumeration = "VoteOption", tag = "1")] @@ -9,6 +10,7 @@ pub struct WeightedVoteOption { } /// Deposit defines an amount deposited by an account address to an active /// proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { #[prost(uint64, tag = "1")] @@ -19,12 +21,13 @@ pub struct Deposit { pub amount: ::prost::alloc::vec::Vec, } /// Proposal defines the core field members of a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { #[prost(uint64, tag = "1")] pub id: u64, #[prost(message, repeated, tag = "2")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, #[prost(enumeration = "ProposalStatus", tag = "3")] pub status: i32, /// final_tally_result is the final tally result of the proposal. When @@ -33,20 +36,21 @@ pub struct Proposal { #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, #[prost(message, optional, tag = "5")] - pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + pub submit_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(message, optional, tag = "6")] - pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub deposit_end_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "8")] - pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_start_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(message, optional, tag = "9")] - pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_end_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// metadata is any arbitrary metadata attached to the proposal. #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, } /// TallyResult defines a standard tally for a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { #[prost(string, tag = "1")] @@ -60,6 +64,7 @@ pub struct TallyResult { } /// Vote defines a vote on a governance proposal. /// A Vote consists of a proposal ID, the voter, and the vote option. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { #[prost(uint64, tag = "1")] @@ -73,6 +78,7 @@ pub struct Vote { pub metadata: ::prost::alloc::string::String, } /// DepositParams defines the params for deposits on governance proposals. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { /// Minimum deposit for a proposal to enter voting period. @@ -81,16 +87,18 @@ pub struct DepositParams { /// 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<::tendermint_proto::google::protobuf::Duration>, } /// VotingParams defines the params for voting on governance proposals. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { /// Length of the voting period. #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option<::prost_types::Duration>, + pub voting_period: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, } /// TallyParams defines the params for tallying votes on governance proposals. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { /// Minimum percentage of total stake needed to vote for a result to be @@ -134,6 +142,17 @@ impl VoteOption { VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), + "VOTE_OPTION_YES" => Some(Self::Yes), + "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), + "VOTE_OPTION_NO" => Some(Self::No), + "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), + _ => None, + } + } } /// ProposalStatus enumerates the valid statuses of a proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -172,8 +191,21 @@ impl ProposalStatus { ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), + "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), + "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), + "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), + "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), + _ => None, + } + } } /// GenesisState defines the gov module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// starting_proposal_id is the ID of the starting proposal. @@ -199,6 +231,7 @@ pub struct GenesisState { pub tally_params: ::core::option::Option, } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { /// proposal_id defines the unique id of the proposal. @@ -206,12 +239,14 @@ pub struct QueryProposalRequest { pub proposal_id: u64, } /// QueryProposalResponse is the response type for the Query/Proposal RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { #[prost(message, optional, tag = "1")] pub proposal: ::core::option::Option, } /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsRequest { /// proposal_status defines the status of the proposals. @@ -229,6 +264,7 @@ pub struct QueryProposalsRequest { } /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { #[prost(message, repeated, tag = "1")] @@ -238,6 +274,7 @@ pub struct QueryProposalsResponse { pub pagination: ::core::option::Option, } /// QueryVoteRequest is the request type for the Query/Vote RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteRequest { /// proposal_id defines the unique id of the proposal. @@ -248,6 +285,7 @@ pub struct QueryVoteRequest { pub voter: ::prost::alloc::string::String, } /// QueryVoteResponse is the response type for the Query/Vote RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { /// vote defined the queried vote. @@ -255,6 +293,7 @@ pub struct QueryVoteResponse { pub vote: ::core::option::Option, } /// QueryVotesRequest is the request type for the Query/Votes RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesRequest { /// proposal_id defines the unique id of the proposal. @@ -265,6 +304,7 @@ pub struct QueryVotesRequest { pub pagination: ::core::option::Option, } /// QueryVotesResponse is the response type for the Query/Votes RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { /// votes defined the queried votes. @@ -275,6 +315,7 @@ pub struct QueryVotesResponse { pub pagination: ::core::option::Option, } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { /// params_type defines which parameters to query for, can be one of "voting", @@ -283,6 +324,7 @@ pub struct QueryParamsRequest { pub params_type: ::prost::alloc::string::String, } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// voting_params defines the parameters related to voting. @@ -296,6 +338,7 @@ pub struct QueryParamsResponse { pub tally_params: ::core::option::Option, } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositRequest { /// proposal_id defines the unique id of the proposal. @@ -306,6 +349,7 @@ pub struct QueryDepositRequest { pub depositor: ::prost::alloc::string::String, } /// QueryDepositResponse is the response type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositResponse { /// deposit defines the requested deposit. @@ -313,6 +357,7 @@ pub struct QueryDepositResponse { pub deposit: ::core::option::Option, } /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsRequest { /// proposal_id defines the unique id of the proposal. @@ -323,6 +368,7 @@ pub struct QueryDepositsRequest { pub pagination: ::core::option::Option, } /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { #[prost(message, repeated, tag = "1")] @@ -332,6 +378,7 @@ pub struct QueryDepositsResponse { pub pagination: ::core::option::Option, } /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { /// proposal_id defines the unique id of the proposal. @@ -339,6 +386,7 @@ pub struct QueryTallyResultRequest { pub proposal_id: u64, } /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { /// tally defines the requested tally. @@ -347,10 +395,11 @@ pub struct QueryTallyResultResponse { } /// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary /// proposal Content. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, #[prost(string, tag = "3")] @@ -360,6 +409,7 @@ pub struct MsgSubmitProposal { pub metadata: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { #[prost(uint64, tag = "1")] @@ -367,19 +417,22 @@ pub struct MsgSubmitProposalResponse { } /// MsgExecLegacyContent is used to wrap the legacy content field into a message. /// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecLegacyContent { /// content is the proposal's content. #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option<::prost_types::Any>, + pub content: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// authority must be the gov module address. #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, } /// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecLegacyContentResponse {} /// MsgVote defines a message to cast a vote. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { #[prost(uint64, tag = "1")] @@ -392,9 +445,11 @@ pub struct MsgVote { pub metadata: ::prost::alloc::string::String, } /// MsgVoteResponse defines the Msg/Vote response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} /// MsgVoteWeighted defines a message to cast a vote. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { #[prost(uint64, tag = "1")] @@ -407,9 +462,11 @@ pub struct MsgVoteWeighted { pub metadata: ::prost::alloc::string::String, } /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeightedResponse {} /// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { #[prost(uint64, tag = "1")] @@ -420,7 +477,9 @@ pub struct MsgDeposit { pub amount: ::prost::alloc::vec::Vec, } /// MsgDepositResponse defines the Msg/Deposit response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositResponse {} +include!("cosmos.gov.v1.serde.rs"); 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..b1603129 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs @@ -0,0 +1,4541 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Deposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Deposit", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Deposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Deposit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DepositParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.min_deposit.is_empty() { + len += 1; + } + if self.max_deposit_period.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.DepositParams", len)?; + if !self.min_deposit.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DepositParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.DepositParams") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.starting_proposal_id != 0 { + len += 1; + } + if !self.deposits.is_empty() { + len += 1; + } + if !self.votes.is_empty() { + len += 1; + } + if !self.proposals.is_empty() { + len += 1; + } + if self.deposit_params.is_some() { + len += 1; + } + if self.voting_params.is_some() { + len += 1; + } + if self.tally_params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.GenesisState", len)?; + if self.starting_proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "startingProposalId", + ToString::to_string(&self.starting_proposal_id).as_str(), + )?; + } + if !self.deposits.is_empty() { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + if !self.proposals.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDeposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgDeposit", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDeposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgDeposit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgDepositResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExecLegacyContent { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.content.is_some() { + len += 1; + } + if !self.authority.is_empty() { + 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 !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExecLegacyContent { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["content", "authority"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Content, + Authority, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgExecLegacyContent") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExecLegacyContentResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExecLegacyContentResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgExecLegacyContentResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.messages.is_empty() { + len += 1; + } + if !self.initial_deposit.is_empty() { + len += 1; + } + if !self.proposer.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposal", len)?; + if !self.messages.is_empty() { + struct_ser.serialize_field("messages", &self.messages)?; + } + if !self.initial_deposit.is_empty() { + struct_ser.serialize_field("initialDeposit", &self.initial_deposit)?; + } + if !self.proposer.is_empty() { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "messages", + "initial_deposit", + "initialDeposit", + "proposer", + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Messages, + InitialDeposit, + Proposer, + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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()?); + } + } + } + Ok(MsgSubmitProposal { + messages: messages__.unwrap_or_default(), + initial_deposit: initial_deposit__.unwrap_or_default(), + proposer: proposer__.unwrap_or_default(), + metadata: metadata__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgSubmitProposal", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposalResponse", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgSubmitProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if self.option != 0 { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVoteResponse") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteWeighted { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if !self.options.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgVoteWeighted", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if !self.options.is_empty() { + struct_ser.serialize_field("options", &self.options)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteWeighted { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVoteWeighted") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgVoteWeightedResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Proposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.id != 0 { + len += 1; + } + if !self.messages.is_empty() { + len += 1; + } + if self.status != 0 { + len += 1; + } + if self.final_tally_result.is_some() { + len += 1; + } + if self.submit_time.is_some() { + len += 1; + } + if self.deposit_end_time.is_some() { + len += 1; + } + if !self.total_deposit.is_empty() { + len += 1; + } + if self.voting_start_time.is_some() { + len += 1; + } + if self.voting_end_time.is_some() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Proposal", len)?; + if self.id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; + } + if !self.messages.is_empty() { + struct_ser.serialize_field("messages", &self.messages)?; + } + if self.status != 0 { + let v = ProposalStatus::try_from(self.status).map_err(|_| { + serde::ser::Error::custom(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 !self.total_deposit.is_empty() { + 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 !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Proposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + Messages, + Status, + FinalTallyResult, + SubmitTime, + DepositEndTime, + TotalDeposit, + VotingStartTime, + VotingEndTime, + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Proposal") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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()?); + } + } + } + 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(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.Proposal", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ProposalStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ProposalStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryDepositRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "depositor"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.deposit.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["deposit"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposit, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryDepositsRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.deposits.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryDepositsResponse", len)?; + if !self.deposits.is_empty() { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["deposits", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposits, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryDepositsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.params_type.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryParamsRequest", len)?; + if !self.params_type.is_empty() { + struct_ser.serialize_field("paramsType", &self.params_type)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params_type", "paramsType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ParamsType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.voting_params.is_some() { + len += 1; + } + if self.deposit_params.is_some() { + len += 1; + } + if self.tally_params.is_some() { + 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)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.v1.QueryParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryProposalRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposal, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_status != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryProposalsRequest", len)?; + if self.proposal_status != 0 { + let v = ProposalStatus::try_from(self.proposal_status).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.proposal_status)) + })?; + struct_ser.serialize_field("proposalStatus", &v)?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.proposals.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryProposalsResponse", len)?; + if !self.proposals.is_empty() { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposals", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposals, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryProposalsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTallyResultRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryTallyResultRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryTallyResultRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTallyResultResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tally.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tally"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tally, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryTallyResultResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVoteRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVoteRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVoteRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "voter"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVoteRequest") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.vote.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["vote"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Vote, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVoteResponse") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryVotesRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVotesRequest") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.votes.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryVotesResponse", len)?; + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["votes", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Votes, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryVotesResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TallyParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.quorum.is_empty() { + len += 1; + } + if !self.threshold.is_empty() { + len += 1; + } + if !self.veto_threshold.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.TallyParams", len)?; + if !self.quorum.is_empty() { + struct_ser.serialize_field("quorum", &self.quorum)?; + } + if !self.threshold.is_empty() { + struct_ser.serialize_field("threshold", &self.threshold)?; + } + if !self.veto_threshold.is_empty() { + struct_ser.serialize_field("vetoThreshold", &self.veto_threshold)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TallyParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.TallyParams") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TallyResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.yes_count.is_empty() { + len += 1; + } + if !self.abstain_count.is_empty() { + len += 1; + } + if !self.no_count.is_empty() { + len += 1; + } + if !self.no_with_veto_count.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.TallyResult", len)?; + if !self.yes_count.is_empty() { + struct_ser.serialize_field("yesCount", &self.yes_count)?; + } + if !self.abstain_count.is_empty() { + struct_ser.serialize_field("abstainCount", &self.abstain_count)?; + } + if !self.no_count.is_empty() { + struct_ser.serialize_field("noCount", &self.no_count)?; + } + if !self.no_with_veto_count.is_empty() { + struct_ser.serialize_field("noWithVetoCount", &self.no_with_veto_count)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TallyResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.TallyResult") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Vote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if !self.options.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Vote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if !self.options.is_empty() { + struct_ser.serialize_field("options", &self.options)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Vote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.Vote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for VoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for VoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for VotingParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.voting_period.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for VotingParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["voting_period", "votingPeriod"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingPeriod, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.VotingParams") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for WeightedVoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.option != 0 { + len += 1; + } + if !self.weight.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.WeightedVoteOption", len)?; + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + if !self.weight.is_empty() { + struct_ser.serialize_field("weight", &self.weight)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for WeightedVoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["option", "weight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Option, + Weight, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.WeightedVoteOption") + } + + fn visit_map(self, mut map_: V) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs index ede6c2bc..5a7a808a 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 @@ -2,6 +2,7 @@ /// WeightedVoteOption defines a unit of vote for vote split. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { #[prost(enumeration = "VoteOption", tag = "1")] @@ -11,6 +12,7 @@ pub struct WeightedVoteOption { } /// TextProposal defines a standard text proposal whose changes need to be /// manually updated in case of approval. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TextProposal { #[prost(string, tag = "1")] @@ -20,6 +22,7 @@ pub struct TextProposal { } /// Deposit defines an amount deposited by an account address to an active /// proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Deposit { #[prost(uint64, tag = "1")] @@ -30,12 +33,13 @@ pub struct Deposit { pub amount: ::prost::alloc::vec::Vec, } /// Proposal defines the core field members of a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { #[prost(uint64, tag = "1")] pub proposal_id: u64, #[prost(message, optional, tag = "2")] - pub content: ::core::option::Option<::prost_types::Any>, + pub content: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(enumeration = "ProposalStatus", tag = "3")] pub status: i32, /// final_tally_result is the final tally result of the proposal. When @@ -44,17 +48,18 @@ pub struct Proposal { #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, #[prost(message, optional, tag = "5")] - pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + pub submit_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(message, optional, tag = "6")] - pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub deposit_end_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(message, repeated, tag = "7")] pub total_deposit: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "8")] - pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_start_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, #[prost(message, optional, tag = "9")] - pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>, + pub voting_end_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, } /// TallyResult defines a standard tally for a governance proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { #[prost(string, tag = "1")] @@ -68,6 +73,7 @@ pub struct TallyResult { } /// Vote defines a vote on a governance proposal. /// A Vote consists of a proposal ID, the voter, and the vote option. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { #[prost(uint64, tag = "1")] @@ -85,6 +91,7 @@ pub struct Vote { pub options: ::prost::alloc::vec::Vec, } /// DepositParams defines the params for deposits on governance proposals. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DepositParams { /// Minimum deposit for a proposal to enter voting period. @@ -93,16 +100,18 @@ pub struct DepositParams { /// 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<::tendermint_proto::google::protobuf::Duration>, } /// VotingParams defines the params for voting on governance proposals. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VotingParams { /// Length of the voting period. #[prost(message, optional, tag = "1")] - pub voting_period: ::core::option::Option<::prost_types::Duration>, + pub voting_period: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, } /// TallyParams defines the params for tallying votes on governance proposals. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyParams { /// Minimum percentage of total stake needed to vote for a result to be @@ -146,6 +155,17 @@ impl VoteOption { VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), + "VOTE_OPTION_YES" => Some(Self::Yes), + "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), + "VOTE_OPTION_NO" => Some(Self::No), + "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), + _ => None, + } + } } /// ProposalStatus enumerates the valid statuses of a proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -184,8 +204,21 @@ impl ProposalStatus { ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_STATUS_DEPOSIT_PERIOD" => Some(Self::DepositPeriod), + "PROPOSAL_STATUS_VOTING_PERIOD" => Some(Self::VotingPeriod), + "PROPOSAL_STATUS_PASSED" => Some(Self::Passed), + "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), + "PROPOSAL_STATUS_FAILED" => Some(Self::Failed), + _ => None, + } + } } /// GenesisState defines the gov module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// starting_proposal_id is the ID of the starting proposal. @@ -211,6 +244,7 @@ pub struct GenesisState { pub tally_params: ::core::option::Option, } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { /// proposal_id defines the unique id of the proposal. @@ -218,12 +252,14 @@ pub struct QueryProposalRequest { pub proposal_id: u64, } /// QueryProposalResponse is the response type for the Query/Proposal RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { #[prost(message, optional, tag = "1")] pub proposal: ::core::option::Option, } /// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsRequest { /// proposal_status defines the status of the proposals. @@ -241,6 +277,7 @@ pub struct QueryProposalsRequest { } /// QueryProposalsResponse is the response type for the Query/Proposals RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsResponse { #[prost(message, repeated, tag = "1")] @@ -250,6 +287,7 @@ pub struct QueryProposalsResponse { pub pagination: ::core::option::Option, } /// QueryVoteRequest is the request type for the Query/Vote RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteRequest { /// proposal_id defines the unique id of the proposal. @@ -260,6 +298,7 @@ pub struct QueryVoteRequest { pub voter: ::prost::alloc::string::String, } /// QueryVoteResponse is the response type for the Query/Vote RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteResponse { /// vote defined the queried vote. @@ -267,6 +306,7 @@ pub struct QueryVoteResponse { pub vote: ::core::option::Option, } /// QueryVotesRequest is the request type for the Query/Votes RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesRequest { /// proposal_id defines the unique id of the proposal. @@ -277,6 +317,7 @@ pub struct QueryVotesRequest { pub pagination: ::core::option::Option, } /// QueryVotesResponse is the response type for the Query/Votes RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesResponse { /// votes defined the queried votes. @@ -287,6 +328,7 @@ pub struct QueryVotesResponse { pub pagination: ::core::option::Option, } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { /// params_type defines which parameters to query for, can be one of "voting", @@ -295,6 +337,7 @@ pub struct QueryParamsRequest { pub params_type: ::prost::alloc::string::String, } /// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// voting_params defines the parameters related to voting. @@ -308,6 +351,7 @@ pub struct QueryParamsResponse { pub tally_params: ::core::option::Option, } /// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositRequest { /// proposal_id defines the unique id of the proposal. @@ -318,6 +362,7 @@ pub struct QueryDepositRequest { pub depositor: ::prost::alloc::string::String, } /// QueryDepositResponse is the response type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositResponse { /// deposit defines the requested deposit. @@ -325,6 +370,7 @@ pub struct QueryDepositResponse { pub deposit: ::core::option::Option, } /// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsRequest { /// proposal_id defines the unique id of the proposal. @@ -335,6 +381,7 @@ pub struct QueryDepositsRequest { pub pagination: ::core::option::Option, } /// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDepositsResponse { #[prost(message, repeated, tag = "1")] @@ -344,6 +391,7 @@ pub struct QueryDepositsResponse { pub pagination: ::core::option::Option, } /// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { /// proposal_id defines the unique id of the proposal. @@ -351,6 +399,7 @@ pub struct QueryTallyResultRequest { pub proposal_id: u64, } /// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { /// tally defines the requested tally. @@ -359,22 +408,25 @@ pub struct QueryTallyResultResponse { } /// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary /// proposal Content. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option<::prost_types::Any>, + pub content: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(message, repeated, tag = "2")] pub initial_deposit: ::prost::alloc::vec::Vec, #[prost(string, tag = "3")] pub proposer: ::prost::alloc::string::String, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { #[prost(uint64, tag = "1")] pub proposal_id: u64, } /// MsgVote defines a message to cast a vote. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { #[prost(uint64, tag = "1")] @@ -385,11 +437,13 @@ pub struct MsgVote { pub option: i32, } /// MsgVoteResponse defines the Msg/Vote response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} /// MsgVoteWeighted defines a message to cast a vote. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { #[prost(uint64, tag = "1")] @@ -402,9 +456,11 @@ pub struct MsgVoteWeighted { /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeightedResponse {} /// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDeposit { #[prost(uint64, tag = "1")] @@ -415,7 +471,9 @@ pub struct MsgDeposit { pub amount: ::prost::alloc::vec::Vec, } /// MsgDepositResponse defines the Msg/Deposit response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositResponse {} +include!("cosmos.gov.v1beta1.serde.rs"); include!("cosmos.gov.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..e67aaac7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.serde.rs @@ -0,0 +1,4432 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Deposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Deposit", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Deposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.Deposit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DepositParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.min_deposit.is_empty() { + len += 1; + } + if self.max_deposit_period.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.DepositParams", len)?; + if !self.min_deposit.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DepositParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.DepositParams") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.starting_proposal_id != 0 { + len += 1; + } + if !self.deposits.is_empty() { + len += 1; + } + if !self.votes.is_empty() { + len += 1; + } + if !self.proposals.is_empty() { + len += 1; + } + if self.deposit_params.is_some() { + len += 1; + } + if self.voting_params.is_some() { + len += 1; + } + if self.tally_params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.GenesisState", len)?; + if self.starting_proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "startingProposalId", + ToString::to_string(&self.starting_proposal_id).as_str(), + )?; + } + if !self.deposits.is_empty() { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + if !self.proposals.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDeposit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgDeposit", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDeposit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgDeposit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgDepositResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.content.is_some() { + len += 1; + } + if !self.initial_deposit.is_empty() { + len += 1; + } + if !self.proposer.is_empty() { + 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 !self.initial_deposit.is_empty() { + struct_ser.serialize_field("initialDeposit", &self.initial_deposit)?; + } + if !self.proposer.is_empty() { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.MsgSubmitProposalResponse", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgSubmitProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if self.option != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.MsgVote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteWeighted { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if !self.options.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.MsgVoteWeighted", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if !self.options.is_empty() { + struct_ser.serialize_field("options", &self.options)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteWeighted { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteWeighted") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteWeightedResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.MsgVoteWeightedResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Proposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.content.is_some() { + len += 1; + } + if self.status != 0 { + len += 1; + } + if self.final_tally_result.is_some() { + len += 1; + } + if self.submit_time.is_some() { + len += 1; + } + if self.deposit_end_time.is_some() { + len += 1; + } + if !self.total_deposit.is_empty() { + len += 1; + } + if self.voting_start_time.is_some() { + len += 1; + } + if self.voting_end_time.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Proposal", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if let Some(v) = self.content.as_ref() { + struct_ser.serialize_field("content", v)?; + } + if self.status != 0 { + let v = ProposalStatus::try_from(self.status).map_err(|_| { + serde::ser::Error::custom(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 !self.total_deposit.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Proposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.Proposal") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ProposalStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ProposalStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "depositor"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Depositor, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.deposit.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["deposit"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposit, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositsRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDepositsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.deposits.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryDepositsResponse", len)?; + if !self.deposits.is_empty() { + struct_ser.serialize_field("deposits", &self.deposits)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDepositsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["deposits", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Deposits, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryDepositsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.params_type.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryParamsRequest", len)?; + if !self.params_type.is_empty() { + struct_ser.serialize_field("paramsType", &self.params_type)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params_type", "paramsType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ParamsType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.voting_params.is_some() { + len += 1; + } + if self.deposit_params.is_some() { + len += 1; + } + if self.tally_params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposal, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_status != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if !self.depositor.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalsRequest", len)?; + if self.proposal_status != 0 { + let v = ProposalStatus::try_from(self.proposal_status).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.proposal_status)) + })?; + struct_ser.serialize_field("proposalStatus", &v)?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.proposals.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryProposalsResponse", len)?; + if !self.proposals.is_empty() { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposals", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposals, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryProposalsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTallyResultRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryTallyResultRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryTallyResultRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTallyResultResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tally.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tally"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tally, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryTallyResultResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVoteRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryVoteRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVoteRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "voter"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVoteRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.vote.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["vote"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Vote, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVoteResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryVotesRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVotesRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.votes.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.QueryVotesResponse", len)?; + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["votes", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Votes, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.QueryVotesResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TallyParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.quorum.is_empty() { + len += 1; + } + if !self.threshold.is_empty() { + len += 1; + } + if !self.veto_threshold.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TallyParams", len)?; + if !self.quorum.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "quorum", + pbjson::private::base64::encode(&self.quorum).as_str(), + )?; + } + if !self.threshold.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "threshold", + pbjson::private::base64::encode(&self.threshold).as_str(), + )?; + } + if !self.veto_threshold.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "vetoThreshold", + pbjson::private::base64::encode(&self.veto_threshold).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TallyParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.TallyParams") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TallyResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.yes.is_empty() { + len += 1; + } + if !self.abstain.is_empty() { + len += 1; + } + if !self.no.is_empty() { + len += 1; + } + if !self.no_with_veto.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TallyResult", len)?; + if !self.yes.is_empty() { + struct_ser.serialize_field("yes", &self.yes)?; + } + if !self.abstain.is_empty() { + struct_ser.serialize_field("abstain", &self.abstain)?; + } + if !self.no.is_empty() { + struct_ser.serialize_field("no", &self.no)?; + } + if !self.no_with_veto.is_empty() { + struct_ser.serialize_field("noWithVeto", &self.no_with_veto)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TallyResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.TallyResult") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TextProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.TextProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TextProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["title", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.TextProposal") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Vote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if self.option != 0 { + len += 1; + } + if !self.options.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1beta1.Vote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + if !self.options.is_empty() { + struct_ser.serialize_field("options", &self.options)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Vote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.Vote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for VoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for VoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for VotingParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.voting_period.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for VotingParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["voting_period", "votingPeriod"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + VotingPeriod, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.VotingParams") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for WeightedVoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.option != 0 { + len += 1; + } + if !self.weight.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1beta1.WeightedVoteOption", len)?; + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + if !self.weight.is_empty() { + struct_ser.serialize_field("weight", &self.weight)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for WeightedVoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["option", "weight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Option, + Weight, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1beta1.WeightedVoteOption") + } + + fn visit_map(self, mut map_: V) -> std::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.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs index 4184a346..951b9c0f 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 @@ -1,6 +1,7 @@ // @generated /// Member represents a group member with an account address, /// non-zero weight, metadata and added_at timestamp. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Member { /// address is the member's account address. @@ -14,11 +15,12 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, } /// MemberRequest represents a group member to be used in Msg server requests. /// Contrary to `Member`, it doesn't have any `added_at` field /// since this field cannot be set as part of requests. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MemberRequest { /// address is the member's account address. @@ -37,6 +39,7 @@ pub struct MemberRequest { /// `threshold`. /// 2. The voting and execution periods of the proposal respect the parameters /// given by `windows`. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ThresholdDecisionPolicy { /// threshold is the minimum weighted sum of `YES` votes that must be met or @@ -53,6 +56,7 @@ pub struct ThresholdDecisionPolicy { /// is greater or equal than the given `percentage`. /// 2. The voting and execution periods of the proposal respect the parameters /// given by `windows`. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PercentageDecisionPolicy { /// percentage is the minimum percentage the weighted sum of `YES` votes must @@ -64,16 +68,17 @@ pub struct PercentageDecisionPolicy { pub windows: ::core::option::Option, } /// DecisionPolicyWindows defines the different windows for voting and execution. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] 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<::tendermint_proto::google::protobuf::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: - /// `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + /// `\[ submission + min_execution_period ; submission + voting_period + max_execution_period\]` /// where max_execution_period is a app-specific config, defined in the keeper. /// If not set, min_execution_period will default to 0. /// @@ -82,13 +87,15 @@ 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<::tendermint_proto::google::protobuf::Duration>, } // // State // /// GroupInfo represents the high-level on-chain information for a group. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupInfo { /// id is the unique ID of the group. @@ -111,9 +118,10 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, } /// GroupMember represents the relationship between a group and a member. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupMember { /// group_id is the unique ID of the group. @@ -124,6 +132,7 @@ pub struct GroupMember { pub member: ::core::option::Option, } /// GroupPolicyInfo represents the high-level on-chain information for a group policy. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GroupPolicyInfo { /// address is the account address of group policy. @@ -144,15 +153,16 @@ 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<::tendermint_proto::google::protobuf::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<::tendermint_proto::google::protobuf::Timestamp>, } /// Proposal defines a group proposal. Any member of a group can submit a proposal /// for a group policy to decide upon. /// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal /// passes as well as some optional metadata associated with the proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Proposal { /// id is the unique id of the proposal. @@ -169,7 +179,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<::tendermint_proto::google::protobuf::Timestamp>, /// group_version tracks the version of the group at proposal submission. /// This field is here for informational purposes only. #[prost(uint64, tag = "6")] @@ -195,15 +205,16 @@ pub struct Proposal { /// 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<::tendermint_proto::google::protobuf::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<::tendermint_proto::google::protobuf::Any>, } /// TallyResult represents the sum of weighted votes for each vote option. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TallyResult { /// yes_count is the weighted sum of yes votes. @@ -220,6 +231,7 @@ pub struct TallyResult { pub no_with_veto_count: ::prost::alloc::string::String, } /// Vote represents a vote for a proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { /// proposal is the unique ID of the proposal. @@ -236,7 +248,7 @@ pub struct Vote { 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<::tendermint_proto::google::protobuf::Timestamp>, } /// VoteOption enumerates the valid vote options for a given proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -268,6 +280,17 @@ impl VoteOption { VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "VOTE_OPTION_UNSPECIFIED" => Some(Self::Unspecified), + "VOTE_OPTION_YES" => Some(Self::Yes), + "VOTE_OPTION_ABSTAIN" => Some(Self::Abstain), + "VOTE_OPTION_NO" => Some(Self::No), + "VOTE_OPTION_NO_WITH_VETO" => Some(Self::NoWithVeto), + _ => None, + } + } } /// ProposalStatus defines proposal statuses. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -305,6 +328,18 @@ impl ProposalStatus { ProposalStatus::Withdrawn => "PROPOSAL_STATUS_WITHDRAWN", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_STATUS_SUBMITTED" => Some(Self::Submitted), + "PROPOSAL_STATUS_ACCEPTED" => Some(Self::Accepted), + "PROPOSAL_STATUS_REJECTED" => Some(Self::Rejected), + "PROPOSAL_STATUS_ABORTED" => Some(Self::Aborted), + "PROPOSAL_STATUS_WITHDRAWN" => Some(Self::Withdrawn), + _ => None, + } + } } /// ProposalExecutorResult defines types of proposal executor results. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -332,8 +367,19 @@ impl ProposalExecutorResult { ProposalExecutorResult::Failure => "PROPOSAL_EXECUTOR_RESULT_FAILURE", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED" => Some(Self::Unspecified), + "PROPOSAL_EXECUTOR_RESULT_NOT_RUN" => Some(Self::NotRun), + "PROPOSAL_EXECUTOR_RESULT_SUCCESS" => Some(Self::Success), + "PROPOSAL_EXECUTOR_RESULT_FAILURE" => Some(Self::Failure), + _ => None, + } + } } /// EventCreateGroup is an event emitted when a group is created. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventCreateGroup { /// group_id is the unique ID of the group. @@ -341,6 +387,7 @@ pub struct EventCreateGroup { pub group_id: u64, } /// EventUpdateGroup is an event emitted when a group is updated. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventUpdateGroup { /// group_id is the unique ID of the group. @@ -348,6 +395,7 @@ pub struct EventUpdateGroup { pub group_id: u64, } /// EventCreateGroupPolicy is an event emitted when a group policy is created. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventCreateGroupPolicy { /// address is the account address of the group policy. @@ -355,6 +403,7 @@ pub struct EventCreateGroupPolicy { pub address: ::prost::alloc::string::String, } /// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventUpdateGroupPolicy { /// address is the account address of the group policy. @@ -362,6 +411,7 @@ pub struct EventUpdateGroupPolicy { pub address: ::prost::alloc::string::String, } /// EventSubmitProposal is an event emitted when a proposal is created. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventSubmitProposal { /// proposal_id is the unique ID of the proposal. @@ -369,6 +419,7 @@ pub struct EventSubmitProposal { pub proposal_id: u64, } /// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventWithdrawProposal { /// proposal_id is the unique ID of the proposal. @@ -376,6 +427,7 @@ pub struct EventWithdrawProposal { pub proposal_id: u64, } /// EventVote is an event emitted when a voter votes on a proposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventVote { /// proposal_id is the unique ID of the proposal. @@ -383,6 +435,7 @@ pub struct EventVote { pub proposal_id: u64, } /// EventExec is an event emitted when a proposal is executed. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventExec { /// proposal_id is the unique ID of the proposal. @@ -396,6 +449,7 @@ pub struct EventExec { pub logs: ::prost::alloc::string::String, } /// EventLeaveGroup is an event emitted when group member leaves the group. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventLeaveGroup { /// group_id is the unique ID of the group. @@ -406,6 +460,7 @@ pub struct EventLeaveGroup { pub address: ::prost::alloc::string::String, } /// EventProposalPruned is an event emitted when a proposal is pruned. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventProposalPruned { /// proposal_id is the unique ID of the proposal. @@ -419,6 +474,7 @@ pub struct EventProposalPruned { pub tally_result: ::core::option::Option, } /// GenesisState defines the group module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// group_seq is the group table orm.Sequence, @@ -450,6 +506,7 @@ pub struct GenesisState { pub votes: ::prost::alloc::vec::Vec, } /// QueryGroupInfoRequest is the Query/GroupInfo request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupInfoRequest { /// group_id is the unique ID of the group. @@ -457,6 +514,7 @@ pub struct QueryGroupInfoRequest { pub group_id: u64, } /// QueryGroupInfoResponse is the Query/GroupInfo response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupInfoResponse { /// info is the GroupInfo for the group. @@ -464,6 +522,7 @@ pub struct QueryGroupInfoResponse { pub info: ::core::option::Option, } /// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPolicyInfoRequest { /// address is the account address of the group policy. @@ -471,6 +530,7 @@ pub struct QueryGroupPolicyInfoRequest { pub address: ::prost::alloc::string::String, } /// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPolicyInfoResponse { /// info is the GroupPolicyInfo for the group policy. @@ -478,6 +538,7 @@ pub struct QueryGroupPolicyInfoResponse { pub info: ::core::option::Option, } /// QueryGroupMembersRequest is the Query/GroupMembers request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupMembersRequest { /// group_id is the unique ID of the group. @@ -488,6 +549,7 @@ pub struct QueryGroupMembersRequest { pub pagination: ::core::option::Option, } /// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupMembersResponse { /// members are the members of the group with given group_id. @@ -498,6 +560,7 @@ pub struct QueryGroupMembersResponse { pub pagination: ::core::option::Option, } /// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByAdminRequest { /// admin is the account address of a group's admin. @@ -508,6 +571,7 @@ pub struct QueryGroupsByAdminRequest { pub pagination: ::core::option::Option, } /// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByAdminResponse { /// groups are the groups info with the provided admin. @@ -518,6 +582,7 @@ pub struct QueryGroupsByAdminResponse { pub pagination: ::core::option::Option, } /// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByGroupRequest { /// group_id is the unique ID of the group policy's group. @@ -528,6 +593,7 @@ pub struct QueryGroupPoliciesByGroupRequest { pub pagination: ::core::option::Option, } /// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByGroupResponse { /// group_policies are the group policies info associated with the provided group. @@ -538,6 +604,7 @@ pub struct QueryGroupPoliciesByGroupResponse { pub pagination: ::core::option::Option, } /// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByAdminRequest { /// admin is the admin address of the group policy. @@ -548,6 +615,7 @@ pub struct QueryGroupPoliciesByAdminRequest { pub pagination: ::core::option::Option, } /// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupPoliciesByAdminResponse { /// group_policies are the group policies info with provided admin. @@ -558,6 +626,7 @@ pub struct QueryGroupPoliciesByAdminResponse { pub pagination: ::core::option::Option, } /// QueryProposalRequest is the Query/Proposal request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalRequest { /// proposal_id is the unique ID of a proposal. @@ -565,6 +634,7 @@ pub struct QueryProposalRequest { pub proposal_id: u64, } /// QueryProposalResponse is the Query/Proposal response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalResponse { /// proposal is the proposal info. @@ -572,6 +642,7 @@ pub struct QueryProposalResponse { pub proposal: ::core::option::Option, } /// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsByGroupPolicyRequest { /// address is the account address of the group policy related to proposals. @@ -582,6 +653,7 @@ pub struct QueryProposalsByGroupPolicyRequest { pub pagination: ::core::option::Option, } /// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryProposalsByGroupPolicyResponse { /// proposals are the proposals with given group policy. @@ -592,6 +664,7 @@ pub struct QueryProposalsByGroupPolicyResponse { pub pagination: ::core::option::Option, } /// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteByProposalVoterRequest { /// proposal_id is the unique ID of a proposal. @@ -602,6 +675,7 @@ pub struct QueryVoteByProposalVoterRequest { pub voter: ::prost::alloc::string::String, } /// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVoteByProposalVoterResponse { /// vote is the vote with given proposal_id and voter. @@ -609,6 +683,7 @@ pub struct QueryVoteByProposalVoterResponse { pub vote: ::core::option::Option, } /// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByProposalRequest { /// proposal_id is the unique ID of a proposal. @@ -619,6 +694,7 @@ pub struct QueryVotesByProposalRequest { pub pagination: ::core::option::Option, } /// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByProposalResponse { /// votes are the list of votes for given proposal_id. @@ -629,6 +705,7 @@ pub struct QueryVotesByProposalResponse { pub pagination: ::core::option::Option, } /// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByVoterRequest { /// voter is a proposal voter account address. @@ -639,6 +716,7 @@ pub struct QueryVotesByVoterRequest { pub pagination: ::core::option::Option, } /// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryVotesByVoterResponse { /// votes are the list of votes by given voter. @@ -649,6 +727,7 @@ pub struct QueryVotesByVoterResponse { pub pagination: ::core::option::Option, } /// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByMemberRequest { /// address is the group member address. @@ -659,6 +738,7 @@ pub struct QueryGroupsByMemberRequest { pub pagination: ::core::option::Option, } /// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsByMemberResponse { /// groups are the groups info with the provided group member. @@ -669,6 +749,7 @@ pub struct QueryGroupsByMemberResponse { pub pagination: ::core::option::Option, } /// QueryTallyResultRequest is the Query/TallyResult request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultRequest { /// proposal_id is the unique id of a proposal. @@ -676,6 +757,7 @@ pub struct QueryTallyResultRequest { pub proposal_id: u64, } /// QueryTallyResultResponse is the Query/TallyResult response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTallyResultResponse { /// tally defines the requested tally. @@ -685,6 +767,7 @@ pub struct QueryTallyResultResponse { /// QueryGroupsRequest is the Query/Groups request type. /// /// Since: cosmos-sdk 0.47.1 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsRequest { /// pagination defines an optional pagination for the request. @@ -694,6 +777,7 @@ pub struct QueryGroupsRequest { /// QueryGroupsResponse is the Query/Groups response type. /// /// Since: cosmos-sdk 0.47.1 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsResponse { /// `groups` is all the groups present in state. @@ -708,6 +792,7 @@ pub struct QueryGroupsResponse { // /// MsgCreateGroup is the Msg/CreateGroup request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroup { /// admin is the account address of the group admin. @@ -721,6 +806,7 @@ pub struct MsgCreateGroup { pub metadata: ::prost::alloc::string::String, } /// MsgCreateGroupResponse is the Msg/CreateGroup response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupResponse { /// group_id is the unique ID of the newly created group. @@ -728,6 +814,7 @@ pub struct MsgCreateGroupResponse { pub group_id: u64, } /// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMembers { /// admin is the account address of the group admin. @@ -742,9 +829,11 @@ pub struct MsgUpdateGroupMembers { pub member_updates: ::prost::alloc::vec::Vec, } /// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMembersResponse {} /// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupAdmin { /// admin is the current account address of the group admin. @@ -758,9 +847,11 @@ pub struct MsgUpdateGroupAdmin { pub new_admin: ::prost::alloc::string::String, } /// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupAdminResponse {} /// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMetadata { /// admin is the account address of the group admin. @@ -774,6 +865,7 @@ pub struct MsgUpdateGroupMetadata { pub metadata: ::prost::alloc::string::String, } /// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupMetadataResponse {} // @@ -781,6 +873,7 @@ pub struct MsgUpdateGroupMetadataResponse {} // /// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupPolicy { /// admin is the account address of the group admin. @@ -794,9 +887,10 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupPolicyResponse { /// address is the account address of the newly created group policy. @@ -804,6 +898,7 @@ pub struct MsgCreateGroupPolicyResponse { pub address: ::prost::alloc::string::String, } /// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyAdmin { /// admin is the account address of the group admin. @@ -817,6 +912,7 @@ pub struct MsgUpdateGroupPolicyAdmin { pub new_admin: ::prost::alloc::string::String, } /// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupWithPolicy { /// admin is the account address of the group and group policy admin. @@ -837,9 +933,10 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateGroupWithPolicyResponse { /// group_id is the unique ID of the newly created group with policy. @@ -850,9 +947,11 @@ pub struct MsgCreateGroupWithPolicyResponse { pub group_policy_address: ::prost::alloc::string::String, } /// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyAdminResponse {} /// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyDecisionPolicy { /// admin is the account address of the group admin. @@ -863,12 +962,14 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyDecisionPolicyResponse {} /// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyMetadata { /// admin is the account address of the group admin. @@ -882,9 +983,11 @@ pub struct MsgUpdateGroupPolicyMetadata { pub metadata: ::prost::alloc::string::String, } /// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateGroupPolicyMetadataResponse {} /// MsgSubmitProposal is the Msg/SubmitProposal request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposal { /// group_policy_address is the account address of group policy. @@ -899,7 +1002,7 @@ pub struct MsgSubmitProposal { 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<::tendermint_proto::google::protobuf::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. @@ -907,6 +1010,7 @@ pub struct MsgSubmitProposal { pub exec: i32, } /// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitProposalResponse { /// proposal is the unique ID of the proposal. @@ -914,6 +1018,7 @@ pub struct MsgSubmitProposalResponse { pub proposal_id: u64, } /// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawProposal { /// proposal is the unique ID of the proposal. @@ -924,9 +1029,11 @@ pub struct MsgWithdrawProposal { pub address: ::prost::alloc::string::String, } /// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawProposalResponse {} /// MsgVote is the Msg/Vote request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVote { /// proposal is the unique ID of the proposal. @@ -947,9 +1054,11 @@ pub struct MsgVote { pub exec: i32, } /// MsgVoteResponse is the Msg/Vote response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteResponse {} /// MsgExec is the Msg/Exec request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExec { /// proposal is the unique ID of the proposal. @@ -960,6 +1069,7 @@ pub struct MsgExec { pub executor: ::prost::alloc::string::String, } /// MsgExecResponse is the Msg/Exec request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecResponse { /// result is the final result of the proposal execution. @@ -967,6 +1077,7 @@ pub struct MsgExecResponse { pub result: i32, } /// MsgLeaveGroup is the Msg/LeaveGroup request type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgLeaveGroup { /// address is the account address of the group member. @@ -977,6 +1088,7 @@ pub struct MsgLeaveGroup { pub group_id: u64, } /// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgLeaveGroupResponse {} // @@ -1007,6 +1119,15 @@ impl Exec { Exec::Try => "EXEC_TRY", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "EXEC_UNSPECIFIED" => Some(Self::Unspecified), + "EXEC_TRY" => Some(Self::Try), + _ => None, + } + } } +include!("cosmos.group.v1.serde.rs"); include!("cosmos.group.v1.tonic.rs"); // @@protoc_insertion_point(module) 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..1eeadb41 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs @@ -0,0 +1,10053 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for DecisionPolicyWindows { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.voting_period.is_some() { + len += 1; + } + if self.min_execution_period.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecisionPolicyWindows { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.DecisionPolicyWindows") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventCreateGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventCreateGroup", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventCreateGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventCreateGroup") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventCreateGroupPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventCreateGroupPolicy", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventCreateGroupPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventCreateGroupPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventExec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.result != 0 { + len += 1; + } + if !self.logs.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventExec", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if self.result != 0 { + let v = ProposalExecutorResult::try_from(self.result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.result)) + })?; + struct_ser.serialize_field("result", &v)?; + } + if !self.logs.is_empty() { + struct_ser.serialize_field("logs", &self.logs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventExec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventExec") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventLeaveGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventLeaveGroup", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventLeaveGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId", "address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventLeaveGroup") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventProposalPruned { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.status != 0 { + len += 1; + } + if self.tally_result.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventProposalPruned", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if self.status != 0 { + let v = ProposalStatus::try_from(self.status).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.status)) + })?; + struct_ser.serialize_field("status", &v)?; + } + if let Some(v) = self.tally_result.as_ref() { + struct_ser.serialize_field("tallyResult", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventProposalPruned { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "status", + "tally_result", + "tallyResult", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Status, + TallyResult, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "status" => Ok(GeneratedField::Status), + "tallyResult" | "tally_result" => Ok(GeneratedField::TallyResult), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventProposalPruned; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventProposalPruned") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut status__ = None; + let mut tally_result__ = 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::Status => { + if status__.is_some() { + return Err(serde::de::Error::duplicate_field("status")); + } + status__ = Some(map_.next_value::()? as i32); + } + GeneratedField::TallyResult => { + if tally_result__.is_some() { + return Err(serde::de::Error::duplicate_field("tallyResult")); + } + tally_result__ = map_.next_value()?; + } + } + } + Ok(EventProposalPruned { + proposal_id: proposal_id__.unwrap_or_default(), + status: status__.unwrap_or_default(), + tally_result: tally_result__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.group.v1.EventProposalPruned", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventSubmitProposal", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventSubmitProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventUpdateGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventUpdateGroup", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventUpdateGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventUpdateGroup") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventUpdateGroupPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventUpdateGroupPolicy", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventUpdateGroupPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventUpdateGroupPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventVote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventVote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventVote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventWithdrawProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.EventWithdrawProposal", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventWithdrawProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventWithdrawProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Exec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "EXEC_UNSPECIFIED", + Self::Try => "EXEC_TRY", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Exec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_seq != 0 { + len += 1; + } + if !self.groups.is_empty() { + len += 1; + } + if !self.group_members.is_empty() { + len += 1; + } + if self.group_policy_seq != 0 { + len += 1; + } + if !self.group_policies.is_empty() { + len += 1; + } + if self.proposal_seq != 0 { + len += 1; + } + if !self.proposals.is_empty() { + len += 1; + } + if !self.votes.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.GenesisState", len)?; + if self.group_seq != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("groupSeq", ToString::to_string(&self.group_seq).as_str())?; + } + if !self.groups.is_empty() { + struct_ser.serialize_field("groups", &self.groups)?; + } + if !self.group_members.is_empty() { + struct_ser.serialize_field("groupMembers", &self.group_members)?; + } + if self.group_policy_seq != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "groupPolicySeq", + ToString::to_string(&self.group_policy_seq).as_str(), + )?; + } + if !self.group_policies.is_empty() { + struct_ser.serialize_field("groupPolicies", &self.group_policies)?; + } + if self.proposal_seq != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalSeq", + ToString::to_string(&self.proposal_seq).as_str(), + )?; + } + if !self.proposals.is_empty() { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GroupInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.id != 0 { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.version != 0 { + len += 1; + } + if !self.total_weight.is_empty() { + len += 1; + } + if self.created_at.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.GroupInfo", len)?; + if self.id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if self.version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; + } + if !self.total_weight.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GroupInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GroupInfo") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GroupMember { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + if self.member.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.GroupMember", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GroupMember { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId", "member"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + Member, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GroupMember") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GroupPolicyInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.group_id != 0 { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.version != 0 { + len += 1; + } + if self.decision_policy.is_some() { + len += 1; + } + if self.created_at.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.GroupPolicyInfo", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if self.version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GroupPolicyInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.GroupPolicyInfo") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Member { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.weight.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.added_at.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.Member", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.weight.is_empty() { + struct_ser.serialize_field("weight", &self.weight)?; + } + if !self.metadata.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Member { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.Member") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MemberRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.weight.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MemberRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.weight.is_empty() { + struct_ser.serialize_field("weight", &self.weight)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MemberRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "weight", "metadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Weight, + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MemberRequest") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.members.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgCreateGroup", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.members.is_empty() { + struct_ser.serialize_field("members", &self.members)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "members", "metadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Members, + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroup") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateGroupPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if self.group_id != 0 { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.decision_policy.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupPolicy", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.metadata.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateGroupPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateGroupPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupPolicyResponse", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateGroupPolicyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupPolicyResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateGroupResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupResponse", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateGroupResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateGroupWithPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.members.is_empty() { + len += 1; + } + if !self.group_metadata.is_empty() { + len += 1; + } + if !self.group_policy_metadata.is_empty() { + len += 1; + } + if self.group_policy_as_admin { + len += 1; + } + if self.decision_policy.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupWithPolicy", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.members.is_empty() { + struct_ser.serialize_field("members", &self.members)?; + } + if !self.group_metadata.is_empty() { + struct_ser.serialize_field("groupMetadata", &self.group_metadata)?; + } + if !self.group_policy_metadata.is_empty() { + struct_ser.serialize_field("groupPolicyMetadata", &self.group_policy_metadata)?; + } + if self.group_policy_as_admin { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateGroupWithPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupWithPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateGroupWithPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + if !self.group_policy_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgCreateGroupWithPolicyResponse", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.group_policy_address.is_empty() { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateGroupWithPolicyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgCreateGroupWithPolicyResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExec { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.executor.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgExec", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.executor.is_empty() { + struct_ser.serialize_field("executor", &self.executor)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExec { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "executor"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Executor, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgExec") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExecResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.result != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgExecResponse", len)?; + if self.result != 0 { + let v = ProposalExecutorResult::try_from(self.result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.result)) + })?; + struct_ser.serialize_field("result", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExecResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["result"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Result, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgExecResponse") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgLeaveGroup { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.group_id != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgLeaveGroup", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgLeaveGroup { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "group_id", "groupId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + GroupId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgLeaveGroup") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgLeaveGroupResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgLeaveGroupResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgLeaveGroupResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.group_policy_address.is_empty() { + len += 1; + } + if !self.proposers.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if !self.messages.is_empty() { + len += 1; + } + if self.exec != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgSubmitProposal", len)?; + if !self.group_policy_address.is_empty() { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if !self.proposers.is_empty() { + struct_ser.serialize_field("proposers", &self.proposers)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if !self.messages.is_empty() { + struct_ser.serialize_field("messages", &self.messages)?; + } + if self.exec != 0 { + let v = Exec::try_from(self.exec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.exec)))?; + struct_ser.serialize_field("exec", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "group_policy_address", + "groupPolicyAddress", + "proposers", + "metadata", + "messages", + "exec", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupPolicyAddress, + Proposers, + Metadata, + Messages, + Exec, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgSubmitProposal") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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); + } + } + } + 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(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.group.v1.MsgSubmitProposal", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgSubmitProposalResponse", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSubmitProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgSubmitProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if self.group_id != 0 { + len += 1; + } + if !self.new_admin.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgUpdateGroupAdmin", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.new_admin.is_empty() { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupAdmin") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupMembers { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if self.group_id != 0 { + len += 1; + } + if !self.member_updates.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgUpdateGroupMembers", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.member_updates.is_empty() { + struct_ser.serialize_field("memberUpdates", &self.member_updates)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMembers { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMembers") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupMembersResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMembersResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMembersResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if self.group_id != 0 { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgUpdateGroupMetadata", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMetadata") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupMetadataResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupMetadataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupMetadataResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupPolicyAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.group_policy_address.is_empty() { + len += 1; + } + if !self.new_admin.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyAdmin", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.group_policy_address.is_empty() { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if !self.new_admin.is_empty() { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyAdmin") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupPolicyAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupPolicyDecisionPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.group_policy_address.is_empty() { + len += 1; + } + if self.decision_policy.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.group_policy_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyDecisionPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupPolicyDecisionPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyDecisionPolicyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupPolicyMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.group_policy_address.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgUpdateGroupPolicyMetadata", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.group_policy_address.is_empty() { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyMetadata") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateGroupPolicyMetadataResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateGroupPolicyMetadataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if self.option != 0 { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.exec != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.MsgVote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if self.exec != 0 { + let v = Exec::try_from(self.exec) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.exec)))?; + struct_ser.serialize_field("exec", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgVote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgVoteResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgVoteResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgVoteResponse") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgWithdrawProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.MsgWithdrawProposal", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgWithdrawProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgWithdrawProposal") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgWithdrawProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgWithdrawProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.MsgWithdrawProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PercentageDecisionPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.percentage.is_empty() { + len += 1; + } + if self.windows.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.PercentageDecisionPolicy", len)?; + if !self.percentage.is_empty() { + struct_ser.serialize_field("percentage", &self.percentage)?; + } + if let Some(v) = self.windows.as_ref() { + struct_ser.serialize_field("windows", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PercentageDecisionPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["percentage", "windows"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Percentage, + Windows, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.PercentageDecisionPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Proposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.id != 0 { + len += 1; + } + if !self.group_policy_address.is_empty() { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if !self.proposers.is_empty() { + len += 1; + } + if self.submit_time.is_some() { + len += 1; + } + if self.group_version != 0 { + len += 1; + } + if self.group_policy_version != 0 { + len += 1; + } + if self.status != 0 { + len += 1; + } + if self.final_tally_result.is_some() { + len += 1; + } + if self.voting_period_end.is_some() { + len += 1; + } + if self.executor_result != 0 { + len += 1; + } + if !self.messages.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.Proposal", len)?; + if self.id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?; + } + if !self.group_policy_address.is_empty() { + struct_ser.serialize_field("groupPolicyAddress", &self.group_policy_address)?; + } + if !self.metadata.is_empty() { + struct_ser.serialize_field("metadata", &self.metadata)?; + } + if !self.proposers.is_empty() { + struct_ser.serialize_field("proposers", &self.proposers)?; + } + if let Some(v) = self.submit_time.as_ref() { + struct_ser.serialize_field("submitTime", v)?; + } + if self.group_version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "groupVersion", + ToString::to_string(&self.group_version).as_str(), + )?; + } + if self.group_policy_version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "groupPolicyVersion", + ToString::to_string(&self.group_policy_version).as_str(), + )?; + } + if self.status != 0 { + let v = ProposalStatus::try_from(self.status).map_err(|_| { + serde::ser::Error::custom(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 self.executor_result != 0 { + let v = ProposalExecutorResult::try_from(self.executor_result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.executor_result)) + })?; + struct_ser.serialize_field("executorResult", &v)?; + } + if !self.messages.is_empty() { + struct_ser.serialize_field("messages", &self.messages)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Proposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + GroupPolicyAddress, + Metadata, + Proposers, + SubmitTime, + GroupVersion, + GroupPolicyVersion, + Status, + FinalTallyResult, + VotingPeriodEnd, + ExecutorResult, + Messages, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.Proposal") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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()?); + } + } + } + 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(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.Proposal", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ProposalExecutorResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ProposalExecutorResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ProposalStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ProposalStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupInfoRequest", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", ToString::to_string(&self.group_id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupInfoRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.info.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["info"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Info, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupInfoResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupMembersRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupMembersRequest", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupMembersRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupMembersRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupMembersResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.members.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupMembersResponse", len)?; + if !self.members.is_empty() { + struct_ser.serialize_field("members", &self.members)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupMembersResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["members", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Members, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupMembersResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupPoliciesByAdminRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupPoliciesByAdminRequest", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByAdminRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByAdminRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupPoliciesByAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.group_policies.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.group.v1.QueryGroupPoliciesByAdminResponse", len)?; + if !self.group_policies.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_policies", "groupPolicies", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupPolicies, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupPoliciesByGroupRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.group_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupPoliciesByGroupRequest", len)?; + if self.group_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("groupId", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByGroupRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_id", "groupId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByGroupRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupPoliciesByGroupResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.group_policies.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.group.v1.QueryGroupPoliciesByGroupResponse", len)?; + if !self.group_policies.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupPoliciesByGroupResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["group_policies", "groupPolicies", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GroupPolicies, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPoliciesByGroupResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupPolicyInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupPolicyInfoRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupPolicyInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPolicyInfoRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupPolicyInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.info.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupPolicyInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["info"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Info, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupPolicyInfoResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupsByAdminRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupsByAdminRequest", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupsByAdminRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByAdminRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupsByAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.groups.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupsByAdminResponse", len)?; + if !self.groups.is_empty() { + struct_ser.serialize_field("groups", &self.groups)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupsByAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["groups", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Groups, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupsByMemberRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupsByMemberRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupsByMemberRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByMemberRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupsByMemberResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.groups.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupsByMemberResponse", len)?; + if !self.groups.is_empty() { + struct_ser.serialize_field("groups", &self.groups)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupsByMemberResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["groups", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Groups, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsByMemberResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryGroupsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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(QueryGroupsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.group.v1.QueryGroupsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGroupsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.groups.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryGroupsResponse", len)?; + if !self.groups.is_empty() { + struct_ser.serialize_field("groups", &self.groups)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGroupsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["groups", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Groups, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryGroupsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryGroupsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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(QueryGroupsResponse { + groups: groups__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.group.v1.QueryGroupsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryProposalRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryProposalRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposal, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalsByGroupPolicyRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.group.v1.QueryProposalsByGroupPolicyRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalsByGroupPolicyRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryProposalsByGroupPolicyRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryProposalsByGroupPolicyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.proposals.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.group.v1.QueryProposalsByGroupPolicyResponse", len)?; + if !self.proposals.is_empty() { + struct_ser.serialize_field("proposals", &self.proposals)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryProposalsByGroupPolicyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposals", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proposals, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryProposalsByGroupPolicyResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTallyResultRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryTallyResultRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTallyResultRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryTallyResultRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTallyResultResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tally.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTallyResultResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tally"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tally, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryTallyResultResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVoteByProposalVoterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryVoteByProposalVoterRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVoteByProposalVoterRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "voter"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Voter, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVoteByProposalVoterRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVoteByProposalVoterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.vote.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVoteByProposalVoterResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["vote"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Vote, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVoteByProposalVoterResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesByProposalRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryVotesByProposalRequest", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesByProposalRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByProposalRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesByProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.votes.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryVotesByProposalResponse", len)?; + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesByProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["votes", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Votes, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesByVoterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.voter.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryVotesByVoterRequest", len)?; + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesByVoterRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["voter", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Voter, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByVoterRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryVotesByVoterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.votes.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.QueryVotesByVoterResponse", len)?; + if !self.votes.is_empty() { + struct_ser.serialize_field("votes", &self.votes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryVotesByVoterResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["votes", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Votes, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.QueryVotesByVoterResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TallyResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.yes_count.is_empty() { + len += 1; + } + if !self.abstain_count.is_empty() { + len += 1; + } + if !self.no_count.is_empty() { + len += 1; + } + if !self.no_with_veto_count.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.TallyResult", len)?; + if !self.yes_count.is_empty() { + struct_ser.serialize_field("yesCount", &self.yes_count)?; + } + if !self.abstain_count.is_empty() { + struct_ser.serialize_field("abstainCount", &self.abstain_count)?; + } + if !self.no_count.is_empty() { + struct_ser.serialize_field("noCount", &self.no_count)?; + } + if !self.no_with_veto_count.is_empty() { + struct_ser.serialize_field("noWithVetoCount", &self.no_with_veto_count)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TallyResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.TallyResult") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ThresholdDecisionPolicy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.threshold.is_empty() { + len += 1; + } + if self.windows.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.group.v1.ThresholdDecisionPolicy", len)?; + if !self.threshold.is_empty() { + struct_ser.serialize_field("threshold", &self.threshold)?; + } + if let Some(v) = self.windows.as_ref() { + struct_ser.serialize_field("windows", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ThresholdDecisionPolicy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["threshold", "windows"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Threshold, + Windows, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.ThresholdDecisionPolicy") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Vote { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.voter.is_empty() { + len += 1; + } + if self.option != 0 { + len += 1; + } + if !self.metadata.is_empty() { + len += 1; + } + if self.submit_time.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.Vote", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.voter.is_empty() { + struct_ser.serialize_field("voter", &self.voter)?; + } + if self.option != 0 { + let v = VoteOption::try_from(self.option).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.option)) + })?; + struct_ser.serialize_field("option", &v)?; + } + if !self.metadata.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Vote { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.group.v1.Vote") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for VoteOption { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for VoteOption { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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.mint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs index 70d49802..9fbb0398 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 @@ -1,5 +1,6 @@ // @generated /// Minter represents the minting state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Minter { /// current annual inflation rate @@ -10,6 +11,7 @@ pub struct Minter { pub annual_provisions: ::prost::alloc::string::String, } /// Params holds parameters for the mint module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// type of coin to mint @@ -32,6 +34,7 @@ pub struct Params { pub blocks_per_year: u64, } /// GenesisState defines the mint module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// minter is a space for holding current inflation information. @@ -42,9 +45,11 @@ pub struct GenesisState { pub params: ::core::option::Option, } /// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::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. @@ -52,10 +57,12 @@ pub struct QueryParamsResponse { pub params: ::core::option::Option, } /// QueryInflationRequest is the request type for the Query/Inflation RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInflationRequest {} /// QueryInflationResponse is the response type for the Query/Inflation RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryInflationResponse { /// inflation is the current minting inflation value. @@ -64,15 +71,18 @@ pub struct QueryInflationResponse { } /// QueryAnnualProvisionsRequest is the request type for the /// Query/AnnualProvisions RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAnnualProvisionsRequest {} /// QueryAnnualProvisionsResponse is the response type for the /// Query/AnnualProvisions RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAnnualProvisionsResponse { /// annual_provisions is the current minting annual provisions value. #[prost(bytes = "vec", tag = "1")] pub annual_provisions: ::prost::alloc::vec::Vec, } +include!("cosmos.mint.v1beta1.serde.rs"); 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..53c957ef --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.serde.rs @@ -0,0 +1,994 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.minter.is_some() { + len += 1; + } + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["minter", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Minter, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Minter { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.inflation.is_empty() { + len += 1; + } + if !self.annual_provisions.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.mint.v1beta1.Minter", len)?; + if !self.inflation.is_empty() { + struct_ser.serialize_field("inflation", &self.inflation)?; + } + if !self.annual_provisions.is_empty() { + struct_ser.serialize_field("annualProvisions", &self.annual_provisions)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Minter { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["inflation", "annual_provisions", "annualProvisions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inflation, + AnnualProvisions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.Minter") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.mint_denom.is_empty() { + len += 1; + } + if !self.inflation_rate_change.is_empty() { + len += 1; + } + if !self.inflation_max.is_empty() { + len += 1; + } + if !self.inflation_min.is_empty() { + len += 1; + } + if !self.goal_bonded.is_empty() { + len += 1; + } + if self.blocks_per_year != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.mint.v1beta1.Params", len)?; + if !self.mint_denom.is_empty() { + struct_ser.serialize_field("mintDenom", &self.mint_denom)?; + } + if !self.inflation_rate_change.is_empty() { + struct_ser.serialize_field("inflationRateChange", &self.inflation_rate_change)?; + } + if !self.inflation_max.is_empty() { + struct_ser.serialize_field("inflationMax", &self.inflation_max)?; + } + if !self.inflation_min.is_empty() { + struct_ser.serialize_field("inflationMin", &self.inflation_min)?; + } + if !self.goal_bonded.is_empty() { + struct_ser.serialize_field("goalBonded", &self.goal_bonded)?; + } + if self.blocks_per_year != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blocksPerYear", + ToString::to_string(&self.blocks_per_year).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAnnualProvisionsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryAnnualProvisionsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAnnualProvisionsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.annual_provisions.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.mint.v1beta1.QueryAnnualProvisionsResponse", len)?; + if !self.annual_provisions.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "annualProvisions", + pbjson::private::base64::encode(&self.annual_provisions).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["annual_provisions", "annualProvisions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AnnualProvisions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryAnnualProvisionsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryInflationRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryInflationRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryInflationRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryInflationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.inflation.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.mint.v1beta1.QueryInflationResponse", len)?; + if !self.inflation.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "inflation", + pbjson::private::base64::encode(&self.inflation).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryInflationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["inflation"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inflation, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryInflationResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.mint.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.nft.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs index 9c48b679..3da7a6fd 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 @@ -1,5 +1,6 @@ // @generated /// EventSend is emitted on Msg/Send +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventSend { #[prost(string, tag = "1")] @@ -12,6 +13,7 @@ pub struct EventSend { pub receiver: ::prost::alloc::string::String, } /// EventMint is emitted on Mint +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventMint { #[prost(string, tag = "1")] @@ -22,6 +24,7 @@ pub struct EventMint { pub owner: ::prost::alloc::string::String, } /// EventBurn is emitted on Burn +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventBurn { #[prost(string, tag = "1")] @@ -32,6 +35,7 @@ pub struct EventBurn { pub owner: ::prost::alloc::string::String, } /// Class defines the class of the nft type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Class { /// id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 @@ -54,9 +58,10 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// NFT defines the NFT. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Nft { /// class_id associated with the NFT, similar to the contract address of ERC721 @@ -73,9 +78,10 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// GenesisState defines the nft module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// class defines the class of the nft type. @@ -85,6 +91,7 @@ pub struct GenesisState { pub entries: ::prost::alloc::vec::Vec, } /// Entry Defines all nft owned by a person +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Entry { /// owner is the owner address of the following nft @@ -95,6 +102,7 @@ pub struct Entry { pub nfts: ::prost::alloc::vec::Vec, } /// QueryBalanceRequest is the request type for the Query/Balance RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceRequest { #[prost(string, tag = "1")] @@ -103,12 +111,14 @@ pub struct QueryBalanceRequest { pub owner: ::prost::alloc::string::String, } /// QueryBalanceResponse is the response type for the Query/Balance RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryBalanceResponse { #[prost(uint64, tag = "1")] pub amount: u64, } /// QueryOwnerRequest is the request type for the Query/Owner RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOwnerRequest { #[prost(string, tag = "1")] @@ -117,24 +127,28 @@ pub struct QueryOwnerRequest { pub id: ::prost::alloc::string::String, } /// QueryOwnerResponse is the response type for the Query/Owner RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryOwnerResponse { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, } /// QuerySupplyRequest is the request type for the Query/Supply RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyRequest { #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, } /// QuerySupplyResponse is the response type for the Query/Supply RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySupplyResponse { #[prost(uint64, tag = "1")] pub amount: u64, } /// QueryNFTstRequest is the request type for the Query/NFTs RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNfTsRequest { #[prost(string, tag = "1")] @@ -145,6 +159,7 @@ pub struct QueryNfTsRequest { pub pagination: ::core::option::Option, } /// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNfTsResponse { #[prost(message, repeated, tag = "1")] @@ -153,6 +168,7 @@ pub struct QueryNfTsResponse { pub pagination: ::core::option::Option, } /// QueryNFTRequest is the request type for the Query/NFT RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNftRequest { #[prost(string, tag = "1")] @@ -161,24 +177,28 @@ pub struct QueryNftRequest { pub id: ::prost::alloc::string::String, } /// QueryNFTResponse is the response type for the Query/NFT RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryNftResponse { #[prost(message, optional, tag = "1")] pub nft: ::core::option::Option, } /// QueryClassRequest is the request type for the Query/Class RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassRequest { #[prost(string, tag = "1")] pub class_id: ::prost::alloc::string::String, } /// QueryClassResponse is the response type for the Query/Class RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassResponse { #[prost(message, optional, tag = "1")] pub class: ::core::option::Option, } /// QueryClassesRequest is the request type for the Query/Classes RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassesRequest { /// pagination defines an optional pagination for the request. @@ -186,6 +206,7 @@ pub struct QueryClassesRequest { pub pagination: ::core::option::Option, } /// QueryClassesResponse is the response type for the Query/Classes RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClassesResponse { #[prost(message, repeated, tag = "1")] @@ -194,6 +215,7 @@ pub struct QueryClassesResponse { pub pagination: ::core::option::Option, } /// MsgSend represents a message to send a nft from one account to another account. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { /// class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 @@ -210,7 +232,9 @@ pub struct MsgSend { pub receiver: ::prost::alloc::string::String, } /// MsgSendResponse defines the Msg/Send response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSendResponse {} +include!("cosmos.nft.v1beta1.serde.rs"); include!("cosmos.nft.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..a61ca837 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.serde.rs @@ -0,0 +1,2724 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Class { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.id.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.symbol.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.uri.is_empty() { + len += 1; + } + if !self.uri_hash.is_empty() { + len += 1; + } + if self.data.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.Class", len)?; + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.symbol.is_empty() { + struct_ser.serialize_field("symbol", &self.symbol)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.uri.is_empty() { + struct_ser.serialize_field("uri", &self.uri)?; + } + if !self.uri_hash.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Class { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.Class") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Entry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.owner.is_empty() { + len += 1; + } + if !self.nfts.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.Entry", len)?; + if !self.owner.is_empty() { + struct_ser.serialize_field("owner", &self.owner)?; + } + if !self.nfts.is_empty() { + struct_ser.serialize_field("nfts", &self.nfts)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Entry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["owner", "nfts"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + Nfts, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.Entry") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventBurn { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + if !self.owner.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.EventBurn", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.owner.is_empty() { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventBurn { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.EventBurn") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventMint { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + if !self.owner.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.EventMint", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.owner.is_empty() { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventMint { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.EventMint") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for EventSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + if !self.sender.is_empty() { + len += 1; + } + if !self.receiver.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.EventSend", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.receiver.is_empty() { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.EventSend") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.classes.is_empty() { + len += 1; + } + if !self.entries.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.GenesisState", len)?; + if !self.classes.is_empty() { + struct_ser.serialize_field("classes", &self.classes)?; + } + if !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["classes", "entries"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Classes, + Entries, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + if !self.sender.is_empty() { + len += 1; + } + if !self.receiver.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.MsgSend", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.receiver.is_empty() { + struct_ser.serialize_field("receiver", &self.receiver)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.MsgSend") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.MsgSendResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Nft { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + if !self.uri.is_empty() { + len += 1; + } + if !self.uri_hash.is_empty() { + len += 1; + } + if self.data.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.nft.v1beta1.NFT", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.uri.is_empty() { + struct_ser.serialize_field("uri", &self.uri)?; + } + if !self.uri_hash.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Nft { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.NFT") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryBalanceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.owner.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryBalanceRequest", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.owner.is_empty() { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryBalanceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["class_id", "classId", "owner"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Owner, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryBalanceRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryBalanceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.amount != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryBalanceResponse", len)?; + if self.amount != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("amount", ToString::to_string(&self.amount).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryBalanceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryBalanceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClassRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryClassRequest", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClassRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["class_id", "classId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClassResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.class.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClassResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["class"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Class, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClassesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClassesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassesRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClassesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.classes.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryClassesResponse", len)?; + if !self.classes.is_empty() { + struct_ser.serialize_field("classes", &self.classes)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClassesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["classes", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Classes, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryClassesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNftRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryNFTRequest", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNftRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["class_id", "classId", "id"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNftResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.nft.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNftResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["nft"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Nft, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNfTsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.owner.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryNFTsRequest", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.owner.is_empty() { + struct_ser.serialize_field("owner", &self.owner)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNfTsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNfTsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.nfts.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryNFTsResponse", len)?; + if !self.nfts.is_empty() { + struct_ser.serialize_field("nfts", &self.nfts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNfTsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["nfts", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Nfts, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryNFTsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryOwnerRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + if !self.id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryOwnerRequest", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + if !self.id.is_empty() { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryOwnerRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["class_id", "classId", "id"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + Id, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryOwnerRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryOwnerResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.owner.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QueryOwnerResponse", len)?; + if !self.owner.is_empty() { + struct_ser.serialize_field("owner", &self.owner)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryOwnerResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["owner"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Owner, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QueryOwnerResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySupplyRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.class_id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QuerySupplyRequest", len)?; + if !self.class_id.is_empty() { + struct_ser.serialize_field("classId", &self.class_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySupplyRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["class_id", "classId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClassId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QuerySupplyRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySupplyResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.amount != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.nft.v1beta1.QuerySupplyResponse", len)?; + if self.amount != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("amount", ToString::to_string(&self.amount).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySupplyResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.nft.v1beta1.QuerySupplyResponse") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs index f73da631..0301a2cb 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs @@ -2,6 +2,8 @@ /// Module defines the ORM module which adds providers to the app container for /// module-scoped DB's. In the future it may provide gRPC services for interacting /// with ORM data. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module {} +include!("cosmos.orm.module.v1alpha1.serde.rs"); // @@protoc_insertion_point(module) 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..632f3636 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs @@ -0,0 +1,79 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.module.v1alpha1.Module") + } + + fn visit_map(self, mut map_: V) -> std::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.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs index 8f1615c5..f444af15 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs @@ -1,5 +1,6 @@ // @generated /// TableDescriptor describes an ORM table. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TableDescriptor { /// primary_key defines the primary key for the table. @@ -15,6 +16,7 @@ pub struct TableDescriptor { pub id: u32, } /// PrimaryKeyDescriptor describes a table primary key. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PrimaryKeyDescriptor { /// fields is a comma-separated list of fields in the primary key. Spaces are @@ -56,6 +58,7 @@ pub struct PrimaryKeyDescriptor { pub auto_increment: bool, } /// PrimaryKeyDescriptor describes a table secondary index. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SecondaryIndexDescriptor { /// fields is a comma-separated list of fields in the index. The supported @@ -79,6 +82,7 @@ pub struct SecondaryIndexDescriptor { pub unique: bool, } /// TableDescriptor describes an ORM singleton table which has at most one instance. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SingletonDescriptor { /// id is a non-zero integer ID that must be unique within the @@ -87,4 +91,5 @@ pub struct SingletonDescriptor { #[prost(uint32, tag = "1")] pub id: u32, } +include!("cosmos.orm.v1.serde.rs"); // @@protoc_insertion_point(module) 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..c39fcf7c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs @@ -0,0 +1,491 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PrimaryKeyDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fields.is_empty() { + len += 1; + } + if self.auto_increment { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.orm.v1.PrimaryKeyDescriptor", len)?; + if !self.fields.is_empty() { + struct_ser.serialize_field("fields", &self.fields)?; + } + if self.auto_increment { + struct_ser.serialize_field("autoIncrement", &self.auto_increment)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PrimaryKeyDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["fields", "auto_increment", "autoIncrement"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fields, + AutoIncrement, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.PrimaryKeyDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SecondaryIndexDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.fields.is_empty() { + len += 1; + } + if self.id != 0 { + len += 1; + } + if self.unique { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.orm.v1.SecondaryIndexDescriptor", len)?; + if !self.fields.is_empty() { + struct_ser.serialize_field("fields", &self.fields)?; + } + if self.id != 0 { + struct_ser.serialize_field("id", &self.id)?; + } + if self.unique { + struct_ser.serialize_field("unique", &self.unique)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SecondaryIndexDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["fields", "id", "unique"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fields, + Id, + Unique, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.SecondaryIndexDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SingletonDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.orm.v1.SingletonDescriptor", len)?; + if self.id != 0 { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SingletonDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["id"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Id, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.SingletonDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TableDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.primary_key.is_some() { + len += 1; + } + if !self.index.is_empty() { + len += 1; + } + if self.id != 0 { + 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 !self.index.is_empty() { + struct_ser.serialize_field("index", &self.index)?; + } + if self.id != 0 { + struct_ser.serialize_field("id", &self.id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TableDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.v1.TableDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs index 9122e8ad..8753b2ec 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs @@ -1,5 +1,6 @@ // @generated /// ModuleSchemaDescriptor describe's a module's ORM schema. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleSchemaDescriptor { #[prost(message, repeated, tag = "1")] @@ -12,6 +13,7 @@ pub struct ModuleSchemaDescriptor { /// Nested message and enum types in `ModuleSchemaDescriptor`. pub mod module_schema_descriptor { /// FileEntry describes an ORM file used in a module. + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FileEntry { /// id is a prefix that will be varint encoded and prepended to all the @@ -78,5 +80,17 @@ impl StorageType { StorageType::Commitment => "STORAGE_TYPE_COMMITMENT", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Some(Self::DefaultUnspecified), + "STORAGE_TYPE_MEMORY" => Some(Self::Memory), + "STORAGE_TYPE_TRANSIENT" => Some(Self::Transient), + "STORAGE_TYPE_INDEX" => Some(Self::Index), + "STORAGE_TYPE_COMMITMENT" => Some(Self::Commitment), + _ => None, + } + } } +include!("cosmos.orm.v1alpha1.serde.rs"); // @@protoc_insertion_point(module) 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..2b5b4f84 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs @@ -0,0 +1,358 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleSchemaDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.schema_file.is_empty() { + len += 1; + } + if !self.prefix.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor", len)?; + if !self.schema_file.is_empty() { + struct_ser.serialize_field("schemaFile", &self.schema_file)?; + } + if !self.prefix.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "prefix", + pbjson::private::base64::encode(&self.prefix).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleSchemaDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["schema_file", "schemaFile", "prefix"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SchemaFile, + Prefix, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.v1alpha1.ModuleSchemaDescriptor") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for module_schema_descriptor::FileEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.id != 0 { + len += 1; + } + if !self.proto_file_name.is_empty() { + len += 1; + } + if self.storage_type != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry", len)?; + if self.id != 0 { + struct_ser.serialize_field("id", &self.id)?; + } + if !self.proto_file_name.is_empty() { + struct_ser.serialize_field("protoFileName", &self.proto_file_name)?; + } + if self.storage_type != 0 { + let v = StorageType::try_from(self.storage_type).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.storage_type)) + })?; + struct_ser.serialize_field("storageType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for module_schema_descriptor::FileEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StorageType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StorageType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs index 59c20e5d..de96b78e 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs @@ -1,5 +1,6 @@ // @generated /// ParameterChangeProposal defines a proposal to change one or more parameters. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParameterChangeProposal { #[prost(string, tag = "1")] @@ -11,6 +12,7 @@ pub struct ParameterChangeProposal { } /// ParamChange defines an individual parameter change, for use in /// ParameterChangeProposal. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ParamChange { #[prost(string, tag = "1")] @@ -21,6 +23,7 @@ pub struct ParamChange { pub value: ::prost::alloc::string::String, } /// QueryParamsRequest is request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest { /// subspace defines the module to query the parameter for. @@ -31,6 +34,7 @@ pub struct QueryParamsRequest { pub key: ::prost::alloc::string::String, } /// QueryParamsResponse is response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// param defines the queried parameter. @@ -41,12 +45,14 @@ pub struct QueryParamsResponse { /// subspaces and all keys for a subspace. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubspacesRequest {} /// QuerySubspacesResponse defines the response types for querying for all /// registered subspaces and all keys for a subspace. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubspacesResponse { #[prost(message, repeated, tag = "1")] @@ -56,6 +62,7 @@ pub struct QuerySubspacesResponse { /// the subspace. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Subspace { #[prost(string, tag = "1")] @@ -63,5 +70,6 @@ pub struct Subspace { #[prost(string, repeated, tag = "2")] pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +include!("cosmos.params.v1beta1.serde.rs"); include!("cosmos.params.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..a06d6009 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.serde.rs @@ -0,0 +1,778 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ParamChange { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.subspace.is_empty() { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.params.v1beta1.ParamChange", len)?; + if !self.subspace.is_empty() { + struct_ser.serialize_field("subspace", &self.subspace)?; + } + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + if !self.value.is_empty() { + struct_ser.serialize_field("value", &self.value)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ParamChange { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["subspace", "key", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspace, + Key, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.ParamChange") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ParameterChangeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.changes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.params.v1beta1.ParameterChangeProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.changes.is_empty() { + struct_ser.serialize_field("changes", &self.changes)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ParameterChangeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["title", "description", "changes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Changes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.ParameterChangeProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.subspace.is_empty() { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.params.v1beta1.QueryParamsRequest", len)?; + if !self.subspace.is_empty() { + struct_ser.serialize_field("subspace", &self.subspace)?; + } + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["subspace", "key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspace, + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.param.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["param"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Param, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySubspacesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySubspacesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QuerySubspacesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySubspacesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.subspaces.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.params.v1beta1.QuerySubspacesResponse", len)?; + if !self.subspaces.is_empty() { + struct_ser.serialize_field("subspaces", &self.subspaces)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySubspacesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["subspaces"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspaces, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.QuerySubspacesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Subspace { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.subspace.is_empty() { + len += 1; + } + if !self.keys.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.params.v1beta1.Subspace", len)?; + if !self.subspace.is_empty() { + struct_ser.serialize_field("subspace", &self.subspace)?; + } + if !self.keys.is_empty() { + struct_ser.serialize_field("keys", &self.keys)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Subspace { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["subspace", "keys"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Subspace, + Keys, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.params.v1beta1.Subspace") + } + + fn visit_map(self, mut map_: V) -> std::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.slashing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs index 31d12936..5eabd3e8 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 @@ -1,6 +1,7 @@ // @generated /// ValidatorSigningInfo defines a validator's signing info for monitoring their /// liveness activity. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSigningInfo { #[prost(string, tag = "1")] @@ -15,7 +16,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<::tendermint_proto::google::protobuf::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")] @@ -26,6 +27,7 @@ pub struct ValidatorSigningInfo { pub missed_blocks_counter: i64, } /// Params represents the parameters used for by the slashing module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { #[prost(int64, tag = "1")] @@ -33,13 +35,15 @@ 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<::tendermint_proto::google::protobuf::Duration>, #[prost(bytes = "vec", tag = "4")] pub slash_fraction_double_sign: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "5")] pub slash_fraction_downtime: ::prost::alloc::vec::Vec, } /// GenesisState defines the slashing module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the paramaters of related to deposit. @@ -55,6 +59,7 @@ pub struct GenesisState { pub missed_blocks: ::prost::alloc::vec::Vec, } /// SigningInfo stores validator signing info of corresponding address. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SigningInfo { /// address is the validator address. @@ -66,6 +71,7 @@ pub struct SigningInfo { } /// ValidatorMissedBlocks contains array of missed blocks of corresponding /// address. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorMissedBlocks { /// address is the validator address. @@ -76,6 +82,7 @@ pub struct ValidatorMissedBlocks { pub missed_blocks: ::prost::alloc::vec::Vec, } /// MissedBlock contains height and missed status as boolean. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MissedBlock { /// index is the height at which the block was missed. @@ -86,9 +93,11 @@ pub struct MissedBlock { pub missed: 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 { #[prost(message, optional, tag = "1")] @@ -96,6 +105,7 @@ pub struct QueryParamsResponse { } /// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfoRequest { /// cons_address is the address to query signing info of @@ -104,6 +114,7 @@ pub struct QuerySigningInfoRequest { } /// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfoResponse { /// val_signing_info is the signing info of requested val cons address @@ -112,6 +123,7 @@ pub struct QuerySigningInfoResponse { } /// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfosRequest { #[prost(message, optional, tag = "1")] @@ -119,6 +131,7 @@ pub struct QuerySigningInfosRequest { } /// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySigningInfosResponse { /// info is the signing info of all validators @@ -128,13 +141,16 @@ pub struct QuerySigningInfosResponse { pub pagination: ::core::option::Option, } /// MsgUnjail defines the Msg/Unjail request type +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnjail { #[prost(string, tag = "1")] pub validator_addr: ::prost::alloc::string::String, } /// MsgUnjailResponse defines the Msg/Unjail response type +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUnjailResponse {} +include!("cosmos.slashing.v1beta1.serde.rs"); 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..47bc4d2b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.serde.rs @@ -0,0 +1,1721 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.signing_infos.is_empty() { + len += 1; + } + if !self.missed_blocks.is_empty() { + 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 !self.signing_infos.is_empty() { + struct_ser.serialize_field("signingInfos", &self.signing_infos)?; + } + if !self.missed_blocks.is_empty() { + struct_ser.serialize_field("missedBlocks", &self.missed_blocks)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MissedBlock { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.index != 0 { + len += 1; + } + if self.missed { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.slashing.v1beta1.MissedBlock", len)?; + if self.index != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; + } + if self.missed { + struct_ser.serialize_field("missed", &self.missed)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MissedBlock { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["index", "missed"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Index, + Missed, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.MissedBlock") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUnjail { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_addr.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.slashing.v1beta1.MsgUnjail", len)?; + if !self.validator_addr.is_empty() { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUnjail { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_addr", "validatorAddr"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.MsgUnjail") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUnjailResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUnjailResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.MsgUnjailResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.signed_blocks_window != 0 { + len += 1; + } + if !self.min_signed_per_window.is_empty() { + len += 1; + } + if self.downtime_jail_duration.is_some() { + len += 1; + } + if !self.slash_fraction_double_sign.is_empty() { + len += 1; + } + if !self.slash_fraction_downtime.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.slashing.v1beta1.Params", len)?; + if self.signed_blocks_window != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "signedBlocksWindow", + ToString::to_string(&self.signed_blocks_window).as_str(), + )?; + } + if !self.min_signed_per_window.is_empty() { + #[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 !self.slash_fraction_double_sign.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "slashFractionDoubleSign", + pbjson::private::base64::encode(&self.slash_fraction_double_sign).as_str(), + )?; + } + if !self.slash_fraction_downtime.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "slashFractionDowntime", + pbjson::private::base64::encode(&self.slash_fraction_downtime).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySigningInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.cons_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.slashing.v1beta1.QuerySigningInfoRequest", len)?; + if !self.cons_address.is_empty() { + struct_ser.serialize_field("consAddress", &self.cons_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySigningInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["cons_address", "consAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfoRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySigningInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.val_signing_info.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySigningInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["val_signing_info", "valSigningInfo"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValSigningInfo, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfoResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySigningInfosRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySigningInfosRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfosRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySigningInfosResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.info.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.slashing.v1beta1.QuerySigningInfosResponse", len)?; + if !self.info.is_empty() { + struct_ser.serialize_field("info", &self.info)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySigningInfosResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["info", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Info, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.QuerySigningInfosResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SigningInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.validator_signing_info.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.slashing.v1beta1.SigningInfo", len)?; + if !self.address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SigningInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "validator_signing_info", "validatorSigningInfo"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + ValidatorSigningInfo, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.SigningInfo") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorMissedBlocks { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.missed_blocks.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.slashing.v1beta1.ValidatorMissedBlocks", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.missed_blocks.is_empty() { + struct_ser.serialize_field("missedBlocks", &self.missed_blocks)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorMissedBlocks { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "missed_blocks", "missedBlocks"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + MissedBlocks, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.ValidatorMissedBlocks") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValidatorSigningInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.start_height != 0 { + len += 1; + } + if self.index_offset != 0 { + len += 1; + } + if self.jailed_until.is_some() { + len += 1; + } + if self.tombstoned { + len += 1; + } + if self.missed_blocks_counter != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.slashing.v1beta1.ValidatorSigningInfo", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if self.start_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "startHeight", + ToString::to_string(&self.start_height).as_str(), + )?; + } + if self.index_offset != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "indexOffset", + ToString::to_string(&self.index_offset).as_str(), + )?; + } + if let Some(v) = self.jailed_until.as_ref() { + struct_ser.serialize_field("jailedUntil", v)?; + } + if self.tombstoned { + struct_ser.serialize_field("tombstoned", &self.tombstoned)?; + } + if self.missed_blocks_counter != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "missedBlocksCounter", + ToString::to_string(&self.missed_blocks_counter).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValidatorSigningInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.slashing.v1beta1.ValidatorSigningInfo") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.staking.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs index 0695b59e..b82d7792 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 @@ -2,6 +2,7 @@ /// StakeAuthorization defines authorization for delegate/undelegate/redelegate. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StakeAuthorization { /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is @@ -18,12 +19,14 @@ pub struct StakeAuthorization { /// Nested message and enum types in `StakeAuthorization`. pub mod stake_authorization { /// Validators defines list of validator addresses. + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validators { #[prost(string, repeated, tag = "1")] pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// validators is the oneof that represents either allow_list or deny_list + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Policy { /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's @@ -63,11 +66,22 @@ impl AuthorizationType { AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), + "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), + "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), + _ => None, + } + } } /// HistoricalInfo contains header and validator information for a given block. /// It is stored as part of staking module's state, which persists the `n` most /// recent HistoricalInfo /// (`n` is set by the staking module's `historical_entries` parameter). +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HistoricalInfo { #[prost(message, optional, tag = "1")] @@ -77,6 +91,7 @@ pub struct HistoricalInfo { } /// CommissionRates defines the initial commission rates to be used for creating /// a validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommissionRates { /// rate is the commission rate charged to delegators, as a fraction. @@ -90,6 +105,7 @@ pub struct CommissionRates { pub max_change_rate: ::prost::alloc::string::String, } /// Commission defines commission parameters for a given validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Commission { /// commission_rates defines the initial commission rates to be used for creating a validator. @@ -97,9 +113,10 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, } /// Description defines a validator description. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Description { /// moniker defines a human-readable name for the validator. @@ -126,6 +143,7 @@ pub struct Description { /// bond shares is based on the amount of coins delegated divided by the current /// exchange rate. Voting power can be calculated as total bonded shares /// multiplied by exchange rate. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { /// operator_address defines the address of the validator's operator; bech encoded in JSON. @@ -133,7 +151,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<::tendermint_proto::google::protobuf::Any>, /// jailed defined whether the validator has been jailed from bonded status or not. #[prost(bool, tag = "3")] pub jailed: bool, @@ -154,7 +172,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<::tendermint_proto::google::protobuf::Timestamp>, /// commission defines the commission parameters. #[prost(message, optional, tag = "10")] pub commission: ::core::option::Option, @@ -165,6 +183,7 @@ pub struct Validator { pub min_self_delegation: ::prost::alloc::string::String, } /// ValAddresses defines a repeated set of validator addresses. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValAddresses { #[prost(string, repeated, tag = "1")] @@ -173,6 +192,7 @@ pub struct ValAddresses { /// DVPair is struct that just has a delegator-validator pair with no other data. /// It is intended to be used as a marshalable pointer. For example, a DVPair can /// be used to construct the key to getting an UnbondingDelegation from state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvPair { #[prost(string, tag = "1")] @@ -181,6 +201,7 @@ pub struct DvPair { pub validator_address: ::prost::alloc::string::String, } /// DVPairs defines an array of DVPair objects. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvPairs { #[prost(message, repeated, tag = "1")] @@ -190,6 +211,7 @@ pub struct DvPairs { /// with no other data. It is intended to be used as a marshalable pointer. For /// example, a DVVTriplet can be used to construct the key to getting a /// Redelegation from state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvvTriplet { #[prost(string, tag = "1")] @@ -200,6 +222,7 @@ pub struct DvvTriplet { pub validator_dst_address: ::prost::alloc::string::String, } /// DVVTriplets defines an array of DVVTriplet objects. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DvvTriplets { #[prost(message, repeated, tag = "1")] @@ -208,6 +231,7 @@ pub struct DvvTriplets { /// Delegation represents the bond with tokens held by an account. It is /// owned by one delegator, and is associated with the voting power of one /// validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Delegation { /// delegator_address is the bech32-encoded address of the delegator. @@ -222,6 +246,7 @@ pub struct Delegation { } /// UnbondingDelegation stores all of a single delegator's unbonding bonds /// for a single validator in an time-ordered list. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegation { /// delegator_address is the bech32-encoded address of the delegator. @@ -237,6 +262,7 @@ pub struct UnbondingDelegation { pub entries: ::prost::alloc::vec::Vec, } /// UnbondingDelegationEntry defines an unbonding object with relevant metadata. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegationEntry { /// creation_height is the height which the unbonding took place. @@ -244,7 +270,7 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, /// initial_balance defines the tokens initially scheduled to receive at completion. #[prost(string, tag = "3")] pub initial_balance: ::prost::alloc::string::String, @@ -253,6 +279,7 @@ pub struct UnbondingDelegationEntry { pub balance: ::prost::alloc::string::String, } /// RedelegationEntry defines a redelegation object with relevant metadata. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationEntry { /// creation_height defines the height which the redelegation took place. @@ -260,7 +287,7 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, /// initial_balance defines the initial balance when redelegation started. #[prost(string, tag = "3")] pub initial_balance: ::prost::alloc::string::String, @@ -270,6 +297,7 @@ pub struct RedelegationEntry { } /// Redelegation contains the list of a particular delegator's redelegating bonds /// from a particular source validator to a particular destination validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Redelegation { /// delegator_address is the bech32-encoded address of the delegator. @@ -288,11 +316,12 @@ pub struct Redelegation { pub entries: ::prost::alloc::vec::Vec, } /// Params defines the parameters for the staking module. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// unbonding_time is the time duration of unbonding. #[prost(message, optional, tag = "1")] - pub unbonding_time: ::core::option::Option<::prost_types::Duration>, + pub unbonding_time: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, /// max_validators is the maximum number of validators. #[prost(uint32, tag = "2")] pub max_validators: u32, @@ -311,6 +340,7 @@ pub struct Params { } /// DelegationResponse is equivalent to Delegation except that it contains a /// balance in addition to shares which is more suitable for client responses. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationResponse { #[prost(message, optional, tag = "1")] @@ -321,6 +351,7 @@ pub struct DelegationResponse { /// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it /// contains a balance in addition to shares which is more suitable for client /// responses. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationEntryResponse { #[prost(message, optional, tag = "1")] @@ -331,6 +362,7 @@ pub struct RedelegationEntryResponse { /// RedelegationResponse is equivalent to a Redelegation except that its entries /// contain a balance in addition to shares which is more suitable for client /// responses. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RedelegationResponse { #[prost(message, optional, tag = "1")] @@ -340,6 +372,7 @@ pub struct RedelegationResponse { } /// Pool is used for tracking bonded and not-bonded token supply of the bond /// denomination. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Pool { #[prost(string, tag = "1")] @@ -373,8 +406,19 @@ impl BondStatus { BondStatus::Bonded => "BOND_STATUS_BONDED", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BOND_STATUS_UNSPECIFIED" => Some(Self::Unspecified), + "BOND_STATUS_UNBONDED" => Some(Self::Unbonded), + "BOND_STATUS_UNBONDING" => Some(Self::Unbonding), + "BOND_STATUS_BONDED" => Some(Self::Bonded), + _ => None, + } + } } /// GenesisState defines the staking module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// params defines all the paramaters of related to deposit. @@ -404,6 +448,7 @@ pub struct GenesisState { pub exported: bool, } /// LastValidatorPower required for validator set update logic. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LastValidatorPower { /// address is the address of the validator. @@ -414,6 +459,7 @@ pub struct LastValidatorPower { pub power: i64, } /// QueryValidatorsRequest is request type for Query/Validators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorsRequest { /// status enables to query for validators matching a given status. @@ -424,6 +470,7 @@ pub struct QueryValidatorsRequest { pub pagination: ::core::option::Option, } /// QueryValidatorsResponse is response type for the Query/Validators RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorsResponse { /// validators contains all the queried validators. @@ -434,6 +481,7 @@ pub struct QueryValidatorsResponse { pub pagination: ::core::option::Option, } /// QueryValidatorRequest is response type for the Query/Validator RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorRequest { /// validator_addr defines the validator address to query for. @@ -441,6 +489,7 @@ pub struct QueryValidatorRequest { pub validator_addr: ::prost::alloc::string::String, } /// QueryValidatorResponse is response type for the Query/Validator RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorResponse { /// validator defines the validator info. @@ -449,6 +498,7 @@ pub struct QueryValidatorResponse { } /// QueryValidatorDelegationsRequest is request type for the /// Query/ValidatorDelegations RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDelegationsRequest { /// validator_addr defines the validator address to query for. @@ -460,6 +510,7 @@ pub struct QueryValidatorDelegationsRequest { } /// QueryValidatorDelegationsResponse is response type for the /// Query/ValidatorDelegations RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorDelegationsResponse { #[prost(message, repeated, tag = "1")] @@ -470,6 +521,7 @@ pub struct QueryValidatorDelegationsResponse { } /// QueryValidatorUnbondingDelegationsRequest is required type for the /// Query/ValidatorUnbondingDelegations RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorUnbondingDelegationsRequest { /// validator_addr defines the validator address to query for. @@ -481,6 +533,7 @@ pub struct QueryValidatorUnbondingDelegationsRequest { } /// QueryValidatorUnbondingDelegationsResponse is response type for the /// Query/ValidatorUnbondingDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorUnbondingDelegationsResponse { #[prost(message, repeated, tag = "1")] @@ -490,6 +543,7 @@ pub struct QueryValidatorUnbondingDelegationsResponse { pub pagination: ::core::option::Option, } /// QueryDelegationRequest is request type for the Query/Delegation RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationRequest { /// delegator_addr defines the delegator address to query for. @@ -500,6 +554,7 @@ pub struct QueryDelegationRequest { pub validator_addr: ::prost::alloc::string::String, } /// QueryDelegationResponse is response type for the Query/Delegation RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegationResponse { /// delegation_responses defines the delegation info of a delegation. @@ -508,6 +563,7 @@ pub struct QueryDelegationResponse { } /// QueryUnbondingDelegationRequest is request type for the /// Query/UnbondingDelegation RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnbondingDelegationRequest { /// delegator_addr defines the delegator address to query for. @@ -519,6 +575,7 @@ pub struct QueryUnbondingDelegationRequest { } /// QueryDelegationResponse is response type for the Query/UnbondingDelegation /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUnbondingDelegationResponse { /// unbond defines the unbonding information of a delegation. @@ -527,6 +584,7 @@ pub struct QueryUnbondingDelegationResponse { } /// QueryDelegatorDelegationsRequest is request type for the /// Query/DelegatorDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorDelegationsRequest { /// delegator_addr defines the delegator address to query for. @@ -538,6 +596,7 @@ pub struct QueryDelegatorDelegationsRequest { } /// QueryDelegatorDelegationsResponse is response type for the /// Query/DelegatorDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorDelegationsResponse { /// delegation_responses defines all the delegations' info of a delegator. @@ -549,6 +608,7 @@ pub struct QueryDelegatorDelegationsResponse { } /// QueryDelegatorUnbondingDelegationsRequest is request type for the /// Query/DelegatorUnbondingDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorUnbondingDelegationsRequest { /// delegator_addr defines the delegator address to query for. @@ -560,6 +620,7 @@ pub struct QueryDelegatorUnbondingDelegationsRequest { } /// QueryUnbondingDelegatorDelegationsResponse is response type for the /// Query/UnbondingDelegatorDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorUnbondingDelegationsResponse { #[prost(message, repeated, tag = "1")] @@ -570,6 +631,7 @@ pub struct QueryDelegatorUnbondingDelegationsResponse { } /// QueryRedelegationsRequest is request type for the Query/Redelegations RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRedelegationsRequest { /// delegator_addr defines the delegator address to query for. @@ -587,6 +649,7 @@ pub struct QueryRedelegationsRequest { } /// QueryRedelegationsResponse is response type for the Query/Redelegations RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRedelegationsResponse { #[prost(message, repeated, tag = "1")] @@ -597,6 +660,7 @@ pub struct QueryRedelegationsResponse { } /// QueryDelegatorValidatorsRequest is request type for the /// Query/DelegatorValidators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsRequest { /// delegator_addr defines the delegator address to query for. @@ -608,6 +672,7 @@ pub struct QueryDelegatorValidatorsRequest { } /// QueryDelegatorValidatorsResponse is response type for the /// Query/DelegatorValidators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { /// validators defines the validators' info of a delegator. @@ -619,6 +684,7 @@ pub struct QueryDelegatorValidatorsResponse { } /// QueryDelegatorValidatorRequest is request type for the /// Query/DelegatorValidator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorRequest { /// delegator_addr defines the delegator address to query for. @@ -630,6 +696,7 @@ pub struct QueryDelegatorValidatorRequest { } /// QueryDelegatorValidatorResponse response type for the /// Query/DelegatorValidator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorResponse { /// validator defines the validator info. @@ -638,6 +705,7 @@ pub struct QueryDelegatorValidatorResponse { } /// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryHistoricalInfoRequest { /// height defines at which height to query the historical info. @@ -646,6 +714,7 @@ pub struct QueryHistoricalInfoRequest { } /// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryHistoricalInfoResponse { /// hist defines the historical info at the given height. @@ -653,9 +722,11 @@ pub struct QueryHistoricalInfoResponse { pub hist: ::core::option::Option, } /// QueryPoolRequest is request type for the Query/Pool RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPoolRequest {} /// QueryPoolResponse is response type for the Query/Pool RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPoolResponse { /// pool defines the pool info. @@ -663,9 +734,11 @@ pub struct QueryPoolResponse { pub pool: ::core::option::Option, } /// QueryParamsRequest is request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} /// QueryParamsResponse is response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params holds all the parameters of this module. @@ -673,6 +746,7 @@ pub struct QueryParamsResponse { pub params: ::core::option::Option, } /// MsgCreateValidator defines a SDK message for creating a new validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateValidator { #[prost(message, optional, tag = "1")] @@ -686,14 +760,16 @@ 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<::tendermint_proto::google::protobuf::Any>, #[prost(message, optional, tag = "7")] pub value: ::core::option::Option, } /// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateValidatorResponse {} /// MsgEditValidator defines a SDK message for editing an existing validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgEditValidator { #[prost(message, optional, tag = "1")] @@ -710,10 +786,12 @@ pub struct MsgEditValidator { pub min_self_delegation: ::prost::alloc::string::String, } /// MsgEditValidatorResponse defines the Msg/EditValidator response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgEditValidatorResponse {} /// MsgDelegate defines a SDK message for performing a delegation of coins /// from a delegator to a validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDelegate { #[prost(string, tag = "1")] @@ -724,10 +802,12 @@ pub struct MsgDelegate { pub amount: ::core::option::Option, } /// MsgDelegateResponse defines the Msg/Delegate response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDelegateResponse {} /// MsgBeginRedelegate defines a SDK message for performing a redelegation /// of coins from a delegator and source validator to a destination validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgBeginRedelegate { #[prost(string, tag = "1")] @@ -740,13 +820,15 @@ pub struct MsgBeginRedelegate { pub amount: ::core::option::Option, } /// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[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<::tendermint_proto::google::protobuf::Timestamp>, } /// MsgUndelegate defines a SDK message for performing an undelegation from a /// delegate and a validator. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUndelegate { #[prost(string, tag = "1")] @@ -757,14 +839,16 @@ pub struct MsgUndelegate { pub amount: ::core::option::Option, } /// MsgUndelegateResponse defines the Msg/Undelegate response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[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<::tendermint_proto::google::protobuf::Timestamp>, } /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegation { #[prost(string, tag = "1")] @@ -781,7 +865,9 @@ pub struct MsgCancelUnbondingDelegation { /// MsgCancelUnbondingDelegationResponse /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegationResponse {} +include!("cosmos.staking.v1beta1.serde.rs"); 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..ec7d5727 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs @@ -0,0 +1,8430 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AuthorizationType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AuthorizationType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for BondStatus { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BondStatus { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Commission { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.commission_rates.is_some() { + len += 1; + } + if self.update_time.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Commission { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Commission") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CommissionRates { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.rate.is_empty() { + len += 1; + } + if !self.max_rate.is_empty() { + len += 1; + } + if !self.max_change_rate.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.CommissionRates", len)?; + if !self.rate.is_empty() { + struct_ser.serialize_field("rate", &self.rate)?; + } + if !self.max_rate.is_empty() { + struct_ser.serialize_field("maxRate", &self.max_rate)?; + } + if !self.max_change_rate.is_empty() { + struct_ser.serialize_field("maxChangeRate", &self.max_change_rate)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CommissionRates { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.CommissionRates") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DvPair { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVPair", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DvPair { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVPair") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DvPairs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.pairs.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.DVPairs", len)?; + if !self.pairs.is_empty() { + struct_ser.serialize_field("pairs", &self.pairs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DvPairs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pairs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pairs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVPairs") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DvvTriplet { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_src_address.is_empty() { + len += 1; + } + if !self.validator_dst_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.DVVTriplet", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_src_address.is_empty() { + struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; + } + if !self.validator_dst_address.is_empty() { + struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DvvTriplet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVVTriplet") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DvvTriplets { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.triplets.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.DVVTriplets", len)?; + if !self.triplets.is_empty() { + struct_ser.serialize_field("triplets", &self.triplets)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DvvTriplets { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["triplets"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Triplets, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DVVTriplets") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Delegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if !self.shares.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.Delegation", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if !self.shares.is_empty() { + struct_ser.serialize_field("shares", &self.shares)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Delegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Delegation") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.delegation.is_some() { + len += 1; + } + if self.balance.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegation", "balance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Delegation, + Balance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.DelegationResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Description { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.moniker.is_empty() { + len += 1; + } + if !self.identity.is_empty() { + len += 1; + } + if !self.website.is_empty() { + len += 1; + } + if !self.security_contact.is_empty() { + len += 1; + } + if !self.details.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.Description", len)?; + if !self.moniker.is_empty() { + struct_ser.serialize_field("moniker", &self.moniker)?; + } + if !self.identity.is_empty() { + struct_ser.serialize_field("identity", &self.identity)?; + } + if !self.website.is_empty() { + struct_ser.serialize_field("website", &self.website)?; + } + if !self.security_contact.is_empty() { + struct_ser.serialize_field("securityContact", &self.security_contact)?; + } + if !self.details.is_empty() { + struct_ser.serialize_field("details", &self.details)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Description { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Description") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.last_total_power.is_empty() { + len += 1; + } + if !self.last_validator_powers.is_empty() { + len += 1; + } + if !self.validators.is_empty() { + len += 1; + } + if !self.delegations.is_empty() { + len += 1; + } + if !self.unbonding_delegations.is_empty() { + len += 1; + } + if !self.redelegations.is_empty() { + len += 1; + } + if self.exported { + 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 !self.last_total_power.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "lastTotalPower", + pbjson::private::base64::encode(&self.last_total_power).as_str(), + )?; + } + if !self.last_validator_powers.is_empty() { + struct_ser.serialize_field("lastValidatorPowers", &self.last_validator_powers)?; + } + if !self.validators.is_empty() { + struct_ser.serialize_field("validators", &self.validators)?; + } + if !self.delegations.is_empty() { + struct_ser.serialize_field("delegations", &self.delegations)?; + } + if !self.unbonding_delegations.is_empty() { + struct_ser.serialize_field("unbondingDelegations", &self.unbonding_delegations)?; + } + if !self.redelegations.is_empty() { + struct_ser.serialize_field("redelegations", &self.redelegations)?; + } + if self.exported { + struct_ser.serialize_field("exported", &self.exported)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for HistoricalInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.header.is_some() { + len += 1; + } + if !self.valset.is_empty() { + 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 !self.valset.is_empty() { + struct_ser.serialize_field("valset", &self.valset)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for HistoricalInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["header", "valset"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Header, + Valset, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.HistoricalInfo") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for LastValidatorPower { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.power != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.LastValidatorPower", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if self.power != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("power", ToString::to_string(&self.power).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for LastValidatorPower { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "power"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Power, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.LastValidatorPower") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgBeginRedelegate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_src_address.is_empty() { + len += 1; + } + if !self.validator_dst_address.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.MsgBeginRedelegate", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_src_address.is_empty() { + struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; + } + if !self.validator_dst_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgBeginRedelegate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgBeginRedelegate") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgBeginRedelegateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.completion_time.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgBeginRedelegateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["completion_time", "completionTime"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CompletionTime, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgBeginRedelegateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelUnbondingDelegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + if self.creation_height != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + if self.creation_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "creationHeight", + ToString::to_string(&self.creation_height).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelUnbondingDelegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCancelUnbondingDelegation") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelUnbondingDelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelUnbondingDelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateValidator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.description.is_some() { + len += 1; + } + if self.commission.is_some() { + len += 1; + } + if !self.min_self_delegation.is_empty() { + len += 1; + } + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if self.pubkey.is_some() { + len += 1; + } + if self.value.is_some() { + 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 !self.min_self_delegation.is_empty() { + struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; + } + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateValidator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCreateValidator") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgCreateValidatorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDelegate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.MsgDelegate", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDelegate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgDelegate") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDelegateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDelegateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgDelegateResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgEditValidator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.description.is_some() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if !self.commission_rate.is_empty() { + len += 1; + } + if !self.min_self_delegation.is_empty() { + 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 !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if !self.commission_rate.is_empty() { + struct_ser.serialize_field("commissionRate", &self.commission_rate)?; + } + if !self.min_self_delegation.is_empty() { + struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgEditValidator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgEditValidator") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgEditValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgEditValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgEditValidatorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUndelegate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegate", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUndelegate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgUndelegate") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUndelegateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.completion_time.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["completion_time", "completionTime"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CompletionTime, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.MsgUndelegateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.unbonding_time.is_some() { + len += 1; + } + if self.max_validators != 0 { + len += 1; + } + if self.max_entries != 0 { + len += 1; + } + if self.historical_entries != 0 { + len += 1; + } + if !self.bond_denom.is_empty() { + len += 1; + } + if !self.min_commission_rate.is_empty() { + 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 self.max_validators != 0 { + struct_ser.serialize_field("maxValidators", &self.max_validators)?; + } + if self.max_entries != 0 { + struct_ser.serialize_field("maxEntries", &self.max_entries)?; + } + if self.historical_entries != 0 { + struct_ser.serialize_field("historicalEntries", &self.historical_entries)?; + } + if !self.bond_denom.is_empty() { + struct_ser.serialize_field("bondDenom", &self.bond_denom)?; + } + if !self.min_commission_rate.is_empty() { + struct_ser.serialize_field("minCommissionRate", &self.min_commission_rate)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Pool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.not_bonded_tokens.is_empty() { + len += 1; + } + if !self.bonded_tokens.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.Pool", len)?; + if !self.not_bonded_tokens.is_empty() { + struct_ser.serialize_field("notBondedTokens", &self.not_bonded_tokens)?; + } + if !self.bonded_tokens.is_empty() { + struct_ser.serialize_field("bondedTokens", &self.bonded_tokens)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Pool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Pool") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegationRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if !self.validator_addr.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.QueryDelegationRequest", len)?; + if !self.delegator_addr.is_empty() { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if !self.validator_addr.is_empty() { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegationRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegationRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.delegation_response.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegation_response", "delegationResponse"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegationResponse, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegationResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest", + len, + )?; + if !self.delegator_addr.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegator_addr", "delegatorAddr", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegation_responses.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse", + len, + )?; + if !self.delegation_responses.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegation_responses", "delegationResponses", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegationResponses, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + len, + )?; + if !self.delegator_addr.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegator_addr", "delegatorAddr", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.unbonding_responses.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + len, + )?; + if !self.unbonding_responses.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["unbonding_responses", "unbondingResponses", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UnbondingResponses, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorValidatorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if !self.validator_addr.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.staking.v1beta1.QueryDelegatorValidatorRequest", len)?; + if !self.delegator_addr.is_empty() { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if !self.validator_addr.is_empty() { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.validator.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validator, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorValidatorsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest", + len, + )?; + if !self.delegator_addr.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegator_addr", "delegatorAddr", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegatorAddr, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDelegatorValidatorsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validators.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse", + len, + )?; + if !self.validators.is_empty() { + struct_ser.serialize_field("validators", &self.validators)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDelegatorValidatorsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validators", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validators, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryHistoricalInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.staking.v1beta1.QueryHistoricalInfoRequest", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryHistoricalInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryHistoricalInfoRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryHistoricalInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.hist.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryHistoricalInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["hist"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Hist, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryHistoricalInfoResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPoolRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPoolRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryPoolRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pool.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pool"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pool, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryPoolResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryRedelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if !self.src_validator_addr.is_empty() { + len += 1; + } + if !self.dst_validator_addr.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.QueryRedelegationsRequest", len)?; + if !self.delegator_addr.is_empty() { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if !self.src_validator_addr.is_empty() { + struct_ser.serialize_field("srcValidatorAddr", &self.src_validator_addr)?; + } + if !self.dst_validator_addr.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryRedelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryRedelegationsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryRedelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.redelegation_responses.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.staking.v1beta1.QueryRedelegationsResponse", len)?; + if !self.redelegation_responses.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryRedelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "redelegation_responses", + "redelegationResponses", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RedelegationResponses, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryRedelegationsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUnbondingDelegationRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_addr.is_empty() { + len += 1; + } + if !self.validator_addr.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryUnbondingDelegationRequest", + len, + )?; + if !self.delegator_addr.is_empty() { + struct_ser.serialize_field("delegatorAddr", &self.delegator_addr)?; + } + if !self.validator_addr.is_empty() { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUnbondingDelegationRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryUnbondingDelegationRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUnbondingDelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.unbond.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUnbondingDelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["unbond"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Unbond, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.QueryUnbondingDelegationResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_addr.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryValidatorDelegationsRequest", + len, + )?; + if !self.validator_addr.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_addr", "validatorAddr", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.QueryValidatorDelegationsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegation_responses.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryValidatorDelegationsResponse", + len, + )?; + if !self.delegation_responses.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["delegation_responses", "delegationResponses", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DelegationResponses, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.staking.v1beta1.QueryValidatorDelegationsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_addr.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorRequest", len)?; + if !self.validator_addr.is_empty() { + struct_ser.serialize_field("validatorAddr", &self.validator_addr)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_addr", "validatorAddr"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.validator.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validator, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validator_addr.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + len, + )?; + if !self.validator_addr.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorUnbondingDelegationsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validator_addr", "validatorAddr", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ValidatorAddr, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.unbonding_responses.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + len, + )?; + if !self.unbonding_responses.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorUnbondingDelegationsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["unbonding_responses", "unbondingResponses", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UnbondingResponses, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.status.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorsRequest", len)?; + if !self.status.is_empty() { + struct_ser.serialize_field("status", &self.status)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["status", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Status, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidatorsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.validators.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.QueryValidatorsResponse", len)?; + if !self.validators.is_empty() { + struct_ser.serialize_field("validators", &self.validators)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidatorsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["validators", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Validators, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.QueryValidatorsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Redelegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_src_address.is_empty() { + len += 1; + } + if !self.validator_dst_address.is_empty() { + len += 1; + } + if !self.entries.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.Redelegation", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_src_address.is_empty() { + struct_ser.serialize_field("validatorSrcAddress", &self.validator_src_address)?; + } + if !self.validator_dst_address.is_empty() { + struct_ser.serialize_field("validatorDstAddress", &self.validator_dst_address)?; + } + if !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Redelegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Redelegation") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for RedelegationEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.creation_height != 0 { + len += 1; + } + if self.completion_time.is_some() { + len += 1; + } + if !self.initial_balance.is_empty() { + len += 1; + } + if !self.shares_dst.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.RedelegationEntry", len)?; + if self.creation_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "creationHeight", + ToString::to_string(&self.creation_height).as_str(), + )?; + } + if let Some(v) = self.completion_time.as_ref() { + struct_ser.serialize_field("completionTime", v)?; + } + if !self.initial_balance.is_empty() { + struct_ser.serialize_field("initialBalance", &self.initial_balance)?; + } + if !self.shares_dst.is_empty() { + struct_ser.serialize_field("sharesDst", &self.shares_dst)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for RedelegationEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "creation_height", + "creationHeight", + "completion_time", + "completionTime", + "initial_balance", + "initialBalance", + "shares_dst", + "sharesDst", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CreationHeight, + CompletionTime, + InitialBalance, + SharesDst, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.RedelegationEntry") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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()?); + } + } + } + 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(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.staking.v1beta1.RedelegationEntry", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for RedelegationEntryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.redelegation_entry.is_some() { + len += 1; + } + if !self.balance.is_empty() { + 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 !self.balance.is_empty() { + struct_ser.serialize_field("balance", &self.balance)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for RedelegationEntryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["redelegation_entry", "redelegationEntry", "balance"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + RedelegationEntry, + Balance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.RedelegationEntryResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for RedelegationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.redelegation.is_some() { + len += 1; + } + if !self.entries.is_empty() { + 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 !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for RedelegationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["redelegation", "entries"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Redelegation, + Entries, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.RedelegationResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StakeAuthorization { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.max_tokens.is_some() { + len += 1; + } + if self.authorization_type != 0 { + 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 self.authorization_type != 0 { + let v = AuthorizationType::try_from(self.authorization_type).map_err(|_| { + serde::ser::Error::custom(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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StakeAuthorization { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.StakeAuthorization") + } + + fn visit_map(self, mut map_: V) -> std::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::<::std::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::<::std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for stake_authorization::Validators { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.staking.v1beta1.StakeAuthorization.Validators", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for stake_authorization::Validators { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.StakeAuthorization.Validators") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for UnbondingDelegation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.delegator_address.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if !self.entries.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegation", len)?; + if !self.delegator_address.is_empty() { + struct_ser.serialize_field("delegatorAddress", &self.delegator_address)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for UnbondingDelegation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.UnbondingDelegation") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for UnbondingDelegationEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.creation_height != 0 { + len += 1; + } + if self.completion_time.is_some() { + len += 1; + } + if !self.initial_balance.is_empty() { + len += 1; + } + if !self.balance.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.UnbondingDelegationEntry", len)?; + if self.creation_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "creationHeight", + ToString::to_string(&self.creation_height).as_str(), + )?; + } + if let Some(v) = self.completion_time.as_ref() { + struct_ser.serialize_field("completionTime", v)?; + } + if !self.initial_balance.is_empty() { + struct_ser.serialize_field("initialBalance", &self.initial_balance)?; + } + if !self.balance.is_empty() { + struct_ser.serialize_field("balance", &self.balance)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for UnbondingDelegationEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "creation_height", + "creationHeight", + "completion_time", + "completionTime", + "initial_balance", + "initialBalance", + "balance", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CreationHeight, + CompletionTime, + InitialBalance, + Balance, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.UnbondingDelegationEntry") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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; + 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()?); + } + } + } + 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(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.staking.v1beta1.UnbondingDelegationEntry", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ValAddresses { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.addresses.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.ValAddresses", len)?; + if !self.addresses.is_empty() { + struct_ser.serialize_field("addresses", &self.addresses)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ValAddresses { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["addresses"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Addresses, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.ValAddresses") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Validator { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.operator_address.is_empty() { + len += 1; + } + if self.consensus_pubkey.is_some() { + len += 1; + } + if self.jailed { + len += 1; + } + if self.status != 0 { + len += 1; + } + if !self.tokens.is_empty() { + len += 1; + } + if !self.delegator_shares.is_empty() { + len += 1; + } + if self.description.is_some() { + len += 1; + } + if self.unbonding_height != 0 { + len += 1; + } + if self.unbonding_time.is_some() { + len += 1; + } + if self.commission.is_some() { + len += 1; + } + if !self.min_self_delegation.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.staking.v1beta1.Validator", len)?; + if !self.operator_address.is_empty() { + struct_ser.serialize_field("operatorAddress", &self.operator_address)?; + } + if let Some(v) = self.consensus_pubkey.as_ref() { + struct_ser.serialize_field("consensusPubkey", v)?; + } + if self.jailed { + struct_ser.serialize_field("jailed", &self.jailed)?; + } + if self.status != 0 { + let v = BondStatus::try_from(self.status).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.status)) + })?; + struct_ser.serialize_field("status", &v)?; + } + if !self.tokens.is_empty() { + struct_ser.serialize_field("tokens", &self.tokens)?; + } + if !self.delegator_shares.is_empty() { + struct_ser.serialize_field("delegatorShares", &self.delegator_shares)?; + } + if let Some(v) = self.description.as_ref() { + struct_ser.serialize_field("description", v)?; + } + if self.unbonding_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "unbondingHeight", + 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 !self.min_self_delegation.is_empty() { + struct_ser.serialize_field("minSelfDelegation", &self.min_self_delegation)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Validator { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + OperatorAddress, + ConsensusPubkey, + Jailed, + Status, + Tokens, + DelegatorShares, + Description, + UnbondingHeight, + UnbondingTime, + Commission, + MinSelfDelegation, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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) + } + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.staking.v1beta1.Validator") + } + + fn visit_map(self, mut map_: V) -> std::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; + 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()?); + } + } + } + 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(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.staking.v1beta1.Validator", + 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..c98eddaf 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 @@ -1,5 +1,6 @@ // @generated /// SignatureDescriptors wraps multiple SignatureDescriptor's. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureDescriptors { /// signatures are the signature descriptors @@ -10,11 +11,12 @@ pub struct SignatureDescriptors { /// a signature including the public key of the signer, signing modes and the /// signature itself. It is primarily used for coordinating signatures between /// clients. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignatureDescriptor { /// public_key is the public key of the signer #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(message, optional, tag = "2")] pub data: ::core::option::Option, /// sequence is the sequence of the account, which describes the @@ -26,6 +28,7 @@ pub struct SignatureDescriptor { /// Nested message and enum types in `SignatureDescriptor`. pub mod signature_descriptor { /// Data represents signature data + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Data { /// sum is the oneof that specifies whether this represents single or multi-signature data @@ -35,6 +38,7 @@ pub mod signature_descriptor { /// Nested message and enum types in `Data`. pub mod data { /// Single is the signature data for a single signer + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Single { /// mode is the signing mode of the single signer @@ -45,6 +49,7 @@ pub mod signature_descriptor { pub signature: ::prost::alloc::vec::Vec, } /// Multi is the signature data for a multisig public key + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Multi { /// bitarray specifies which keys within the multisig are signing @@ -57,6 +62,7 @@ pub mod signature_descriptor { pub signatures: ::prost::alloc::vec::Vec, } /// sum is the oneof that specifies whether this represents single or multi-signature data + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { /// single represents a single signer @@ -126,5 +132,18 @@ impl SignMode { SignMode::Eip191 => "SIGN_MODE_EIP_191", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SIGN_MODE_UNSPECIFIED" => Some(Self::Unspecified), + "SIGN_MODE_DIRECT" => Some(Self::Direct), + "SIGN_MODE_TEXTUAL" => Some(Self::Textual), + "SIGN_MODE_DIRECT_AUX" => Some(Self::DirectAux), + "SIGN_MODE_LEGACY_AMINO_JSON" => Some(Self::LegacyAminoJson), + "SIGN_MODE_EIP_191" => Some(Self::Eip191), + _ => None, + } + } } +include!("cosmos.tx.signing.v1beta1.serde.rs"); // @@protoc_insertion_point(module) 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..3a33f86a --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.serde.rs @@ -0,0 +1,698 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for SignMode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignMode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignatureDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.public_key.is_some() { + len += 1; + } + if self.data.is_some() { + len += 1; + } + if self.sequence != 0 { + 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 self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignatureDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for signature_descriptor::Data { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for signature_descriptor::Data { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["single", "multi"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Single, + Multi, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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::<::std::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::<::std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for signature_descriptor::data::Multi { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.bitarray.is_some() { + len += 1; + } + if !self.signatures.is_empty() { + 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 !self.signatures.is_empty() { + struct_ser.serialize_field("signatures", &self.signatures)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Multi { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["bitarray", "signatures"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bitarray, + Signatures, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for signature_descriptor::data::Single { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.mode != 0 { + len += 1; + } + if !self.signature.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single", + len, + )?; + if self.mode != 0 { + let v = SignMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + if !self.signature.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "signature", + pbjson::private::base64::encode(&self.signature).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for signature_descriptor::data::Single { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["mode", "signature"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Mode, + Signature, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignatureDescriptors { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signatures.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.signing.v1beta1.SignatureDescriptors", len)?; + if !self.signatures.is_empty() { + struct_ser.serialize_field("signatures", &self.signatures)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignatureDescriptors { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signatures"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signatures, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.signing.v1beta1.SignatureDescriptors") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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..def3d18b 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 @@ -1,5 +1,6 @@ // @generated /// Tx is the standard type used for broadcasting transactions. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tx { /// body is the processable content of the transaction @@ -20,6 +21,7 @@ pub struct Tx { /// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and /// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used /// as the transaction ID. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxRaw { /// body_bytes is a protobuf serialization of a TxBody that matches the @@ -37,6 +39,7 @@ pub struct TxRaw { pub signatures: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } /// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignDoc { /// body_bytes is protobuf serialization of a TxBody that matches the @@ -60,6 +63,7 @@ pub struct SignDoc { /// SIGN_MODE_DIRECT_AUX. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignDocDirectAux { /// body_bytes is protobuf serialization of a TxBody that matches the @@ -68,7 +72,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<::tendermint_proto::google::protobuf::Any>, /// chain_id is the identifier of the chain this transaction targets. /// It prevents signed transactions from being used on another chain by an /// attacker. @@ -90,6 +94,7 @@ pub struct SignDocDirectAux { pub tip: ::core::option::Option, } /// TxBody is the body of a transaction that all signers sign over. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxBody { /// messages is a list of messages to be executed. The required signers of @@ -100,7 +105,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<::tendermint_proto::google::protobuf::Any>, /// memo is any arbitrary note/comment to be added to the transaction. /// WARNING: in clients, any publicly exposed text should not be called memo, /// but should be called `note` instead (see ). @@ -114,15 +119,17 @@ 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<::tendermint_proto::google::protobuf::Any>, /// extension_options are arbitrary options that can be added by chains /// when the default options are not sufficient. If any of these are present /// and can't be handled, they will be ignored #[prost(message, repeated, tag = "2047")] - pub non_critical_extension_options: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub non_critical_extension_options: + ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, } /// AuthInfo describes the fee and signer modes that are used to sign a /// transaction. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuthInfo { /// signer_infos defines the signing modes for the required signers. The number @@ -148,13 +155,14 @@ pub struct AuthInfo { } /// SignerInfo describes the public key and signing mode of a single top-level /// signer. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignerInfo { /// public_key is the public key of the signer. It is optional for accounts /// that already exist in state. If unset, the verifier can use the required \ /// signer address for this position and lookup the public key. #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// mode_info describes the signing mode of the signer and is a nested /// structure to support nested multisig pubkey's #[prost(message, optional, tag = "2")] @@ -166,6 +174,7 @@ pub struct SignerInfo { pub sequence: u64, } /// ModeInfo describes the signing mode of a single or nested multisig signer. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModeInfo { /// sum is the oneof that specifies whether this represents a single or nested @@ -178,6 +187,7 @@ pub mod mode_info { /// Single is the mode info for a single signer. It is structured as a message /// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the /// future + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Single { /// mode is the signing mode of the single signer @@ -185,6 +195,7 @@ pub mod mode_info { pub mode: i32, } /// Multi is the mode info for a multisig public key + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Multi { /// bitarray specifies which keys within the multisig are signing @@ -198,6 +209,7 @@ pub mod mode_info { } /// sum is the oneof that specifies whether this represents a single or nested /// multisig signer + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { /// single represents a single signer @@ -211,6 +223,7 @@ pub mod mode_info { /// Fee includes the amount of coins paid in fees and the maximum /// gas to be used by the transaction. The ratio yields an effective "gasprice", /// which must be above some miminum to be accepted into the mempool. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fee { /// amount is the amount of coins to be paid as a fee @@ -234,6 +247,7 @@ pub struct Fee { /// Tip is the tip used for meta-transactions. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tip { /// amount is the amount of the tip @@ -249,6 +263,7 @@ pub struct Tip { /// by the node if sent directly as-is. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuxSignerData { /// address is the bech32-encoded address of the auxiliary signer. If using @@ -270,6 +285,7 @@ pub struct AuxSignerData { } /// GetTxsEventRequest is the request type for the Service.TxsByEvents /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxsEventRequest { /// events is the list of transaction event type. @@ -292,6 +308,7 @@ pub struct GetTxsEventRequest { } /// GetTxsEventResponse is the response type for the Service.TxsByEvents /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxsEventResponse { /// txs is the list of queried transactions. @@ -311,6 +328,7 @@ pub struct GetTxsEventResponse { } /// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BroadcastTxRequest { /// tx_bytes is the raw transaction. @@ -321,6 +339,7 @@ pub struct BroadcastTxRequest { } /// BroadcastTxResponse is the response type for the /// Service.BroadcastTx method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BroadcastTxResponse { /// tx_response is the queried TxResponses. @@ -329,6 +348,7 @@ pub struct BroadcastTxResponse { } /// SimulateRequest is the request type for the Service.Simulate /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulateRequest { /// tx is the transaction to simulate. @@ -344,6 +364,7 @@ pub struct SimulateRequest { } /// SimulateResponse is the response type for the /// Service.SimulateRPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SimulateResponse { /// gas_info is the information about gas used in the simulation. @@ -355,6 +376,7 @@ pub struct SimulateResponse { } /// GetTxRequest is the request type for the Service.GetTx /// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxRequest { /// hash is the tx hash to query, encoded as a hex string. @@ -362,6 +384,7 @@ pub struct GetTxRequest { pub hash: ::prost::alloc::string::String, } /// GetTxResponse is the response type for the Service.GetTx method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxResponse { /// tx is the queried transaction. @@ -375,6 +398,7 @@ pub struct GetTxResponse { /// RPC method. /// /// Since: cosmos-sdk 0.45.2 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockWithTxsRequest { /// height is the height of the block to query. @@ -387,6 +411,7 @@ pub struct GetBlockWithTxsRequest { /// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. /// /// Since: cosmos-sdk 0.45.2 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockWithTxsResponse { /// txs are the transactions in the block. @@ -423,6 +448,15 @@ impl OrderBy { OrderBy::Desc => "ORDER_BY_DESC", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ORDER_BY_UNSPECIFIED" => Some(Self::Unspecified), + "ORDER_BY_ASC" => Some(Self::Asc), + "ORDER_BY_DESC" => Some(Self::Desc), + _ => None, + } + } } /// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -453,6 +487,17 @@ impl BroadcastMode { BroadcastMode::Async => "BROADCAST_MODE_ASYNC", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "BROADCAST_MODE_UNSPECIFIED" => Some(Self::Unspecified), + "BROADCAST_MODE_BLOCK" => Some(Self::Block), + "BROADCAST_MODE_SYNC" => Some(Self::Sync), + "BROADCAST_MODE_ASYNC" => Some(Self::Async), + _ => None, + } + } } +include!("cosmos.tx.v1beta1.serde.rs"); include!("cosmos.tx.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..37cc696a --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs @@ -0,0 +1,3306 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AuthInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer_infos.is_empty() { + len += 1; + } + if self.fee.is_some() { + len += 1; + } + if self.tip.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.AuthInfo", len)?; + if !self.signer_infos.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AuthInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.AuthInfo") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AuxSignerData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.sign_doc.is_some() { + len += 1; + } + if self.mode != 0 { + len += 1; + } + if !self.sig.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.AuxSignerData", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.sign_doc.as_ref() { + struct_ser.serialize_field("signDoc", v)?; + } + if self.mode != 0 { + let v = super::signing::v1beta1::SignMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + if !self.sig.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("sig", pbjson::private::base64::encode(&self.sig).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AuxSignerData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.AuxSignerData") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for BroadcastMode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BroadcastMode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for BroadcastTxRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.tx_bytes.is_empty() { + len += 1; + } + if self.mode != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.BroadcastTxRequest", len)?; + if !self.tx_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "txBytes", + pbjson::private::base64::encode(&self.tx_bytes).as_str(), + )?; + } + if self.mode != 0 { + let v = BroadcastMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BroadcastTxRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tx_bytes", "txBytes", "mode"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TxBytes, + Mode, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.BroadcastTxRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for BroadcastTxResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tx_response.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BroadcastTxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tx_response", "txResponse"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TxResponse, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.BroadcastTxResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Fee { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.amount.is_empty() { + len += 1; + } + if self.gas_limit != 0 { + len += 1; + } + if !self.payer.is_empty() { + len += 1; + } + if !self.granter.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.Fee", len)?; + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + if self.gas_limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("gasLimit", ToString::to_string(&self.gas_limit).as_str())?; + } + if !self.payer.is_empty() { + struct_ser.serialize_field("payer", &self.payer)?; + } + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Fee { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.Fee") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetBlockWithTxsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.GetBlockWithTxsRequest", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetBlockWithTxsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetBlockWithTxsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetBlockWithTxsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.txs.is_empty() { + len += 1; + } + if self.block_id.is_some() { + len += 1; + } + if self.block.is_some() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.GetBlockWithTxsResponse", len)?; + if !self.txs.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetBlockWithTxsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetBlockWithTxsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetTxRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.hash.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.GetTxRequest", len)?; + if !self.hash.is_empty() { + struct_ser.serialize_field("hash", &self.hash)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetTxRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["hash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Hash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxRequest") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetTxResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tx.is_some() { + len += 1; + } + if self.tx_response.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetTxResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tx", "tx_response", "txResponse"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tx, + TxResponse, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxResponse") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetTxsEventRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.events.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if self.order_by != 0 { + len += 1; + } + if self.page != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.GetTxsEventRequest", len)?; + if !self.events.is_empty() { + struct_ser.serialize_field("events", &self.events)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if self.order_by != 0 { + let v = OrderBy::try_from(self.order_by).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.order_by)) + })?; + struct_ser.serialize_field("orderBy", &v)?; + } + if self.page != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("page", ToString::to_string(&self.page).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxsEventRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GetTxsEventResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.txs.is_empty() { + len += 1; + } + if !self.tx_responses.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if self.total != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.GetTxsEventResponse", len)?; + if !self.txs.is_empty() { + struct_ser.serialize_field("txs", &self.txs)?; + } + if !self.tx_responses.is_empty() { + struct_ser.serialize_field("txResponses", &self.tx_responses)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if self.total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GetTxsEventResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.GetTxsEventResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModeInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModeInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["single", "multi"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Single, + Multi, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.ModeInfo") + } + + fn visit_map(self, mut map_: V) -> std::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::<::std::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::<::std::option::Option<_>>()? + .map(mode_info::Sum::Multi); + } + } + } + Ok(ModeInfo { sum: sum__ }) + } + } + deserializer.deserialize_struct("cosmos.tx.v1beta1.ModeInfo", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for mode_info::Multi { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.bitarray.is_some() { + len += 1; + } + if !self.mode_infos.is_empty() { + 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 !self.mode_infos.is_empty() { + struct_ser.serialize_field("modeInfos", &self.mode_infos)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for mode_info::Multi { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["bitarray", "mode_infos", "modeInfos"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Bitarray, + ModeInfos, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.ModeInfo.Multi") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for mode_info::Single { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.mode != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.ModeInfo.Single", len)?; + if self.mode != 0 { + let v = super::signing::v1beta1::SignMode::try_from(self.mode) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.mode)))?; + struct_ser.serialize_field("mode", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for mode_info::Single { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["mode"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Mode, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.ModeInfo.Single") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for OrderBy { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for OrderBy { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignDoc { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.body_bytes.is_empty() { + len += 1; + } + if !self.auth_info_bytes.is_empty() { + len += 1; + } + if !self.chain_id.is_empty() { + len += 1; + } + if self.account_number != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.SignDoc", len)?; + if !self.body_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "bodyBytes", + pbjson::private::base64::encode(&self.body_bytes).as_str(), + )?; + } + if !self.auth_info_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "authInfoBytes", + pbjson::private::base64::encode(&self.auth_info_bytes).as_str(), + )?; + } + if !self.chain_id.is_empty() { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if self.account_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "accountNumber", + ToString::to_string(&self.account_number).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignDoc { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SignDoc") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignDocDirectAux { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.body_bytes.is_empty() { + len += 1; + } + if self.public_key.is_some() { + len += 1; + } + if !self.chain_id.is_empty() { + len += 1; + } + if self.account_number != 0 { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + if self.tip.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.tx.v1beta1.SignDocDirectAux", len)?; + if !self.body_bytes.is_empty() { + #[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 !self.chain_id.is_empty() { + struct_ser.serialize_field("chainId", &self.chain_id)?; + } + if self.account_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "accountNumber", + ToString::to_string(&self.account_number).as_str(), + )?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + if let Some(v) = self.tip.as_ref() { + struct_ser.serialize_field("tip", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignDocDirectAux { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SignDocDirectAux") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignerInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.public_key.is_some() { + len += 1; + } + if self.mode_info.is_some() { + len += 1; + } + if self.sequence != 0 { + 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 self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignerInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SignerInfo") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SimulateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.tx.is_some() { + len += 1; + } + if !self.tx_bytes.is_empty() { + 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 !self.tx_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "txBytes", + pbjson::private::base64::encode(&self.tx_bytes).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SimulateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["tx", "tx_bytes", "txBytes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Tx, + TxBytes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SimulateRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SimulateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.gas_info.is_some() { + len += 1; + } + if self.result.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SimulateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["gas_info", "gasInfo", "result"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GasInfo, + Result, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.SimulateResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Tip { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.amount.is_empty() { + len += 1; + } + if !self.tipper.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.Tip", len)?; + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + if !self.tipper.is_empty() { + struct_ser.serialize_field("tipper", &self.tipper)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Tip { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount", "tipper"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Amount, + Tipper, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.Tip") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Tx { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.body.is_some() { + len += 1; + } + if self.auth_info.is_some() { + len += 1; + } + if !self.signatures.is_empty() { + 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 !self.signatures.is_empty() { + struct_ser.serialize_field( + "signatures", + &self + .signatures + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Tx { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.Tx") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TxBody { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.messages.is_empty() { + len += 1; + } + if !self.memo.is_empty() { + len += 1; + } + if self.timeout_height != 0 { + len += 1; + } + if !self.extension_options.is_empty() { + len += 1; + } + if !self.non_critical_extension_options.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.TxBody", len)?; + if !self.messages.is_empty() { + struct_ser.serialize_field("messages", &self.messages)?; + } + if !self.memo.is_empty() { + struct_ser.serialize_field("memo", &self.memo)?; + } + if self.timeout_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "timeoutHeight", + ToString::to_string(&self.timeout_height).as_str(), + )?; + } + if !self.extension_options.is_empty() { + struct_ser.serialize_field("extensionOptions", &self.extension_options)?; + } + if !self.non_critical_extension_options.is_empty() { + struct_ser.serialize_field( + "nonCriticalExtensionOptions", + &self.non_critical_extension_options, + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TxBody { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxBody") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TxRaw { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.body_bytes.is_empty() { + len += 1; + } + if !self.auth_info_bytes.is_empty() { + len += 1; + } + if !self.signatures.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.TxRaw", len)?; + if !self.body_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "bodyBytes", + pbjson::private::base64::encode(&self.body_bytes).as_str(), + )?; + } + if !self.auth_info_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "authInfoBytes", + pbjson::private::base64::encode(&self.auth_info_bytes).as_str(), + )?; + } + if !self.signatures.is_empty() { + struct_ser.serialize_field( + "signatures", + &self + .signatures + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TxRaw { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.tx.v1beta1.TxRaw") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs index cd3ad7d9..fa4ab6f8 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 @@ -1,5 +1,6 @@ // @generated /// 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 @@ -16,7 +17,7 @@ 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<::tendermint_proto::google::protobuf::Timestamp>, /// The height at which the upgrade must be performed. /// Only used if Time is not set. #[prost(int64, tag = "3")] @@ -30,12 +31,13 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// SoftwareUpgradeProposal is a gov Content type for initiating a software /// upgrade. /// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov /// proposals, see MsgSoftwareUpgrade. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { #[prost(string, tag = "1")] @@ -49,6 +51,7 @@ pub struct SoftwareUpgradeProposal { /// upgrade. /// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov /// proposals, see MsgCancelUpgrade. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { #[prost(string, tag = "1")] @@ -59,6 +62,7 @@ pub struct CancelSoftwareUpgradeProposal { /// ModuleVersion specifies a module and its consensus version. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleVersion { /// name of the app module @@ -70,10 +74,12 @@ pub struct ModuleVersion { } /// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanRequest {} /// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCurrentPlanResponse { /// plan is the current upgrade plan. @@ -82,6 +88,7 @@ pub struct QueryCurrentPlanResponse { } /// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanRequest { /// name is the name of the applied plan to query for. @@ -90,6 +97,7 @@ pub struct QueryAppliedPlanRequest { } /// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC /// method. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAppliedPlanResponse { /// height is the block height at which the plan was applied. @@ -98,6 +106,7 @@ pub struct QueryAppliedPlanResponse { } /// 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 { /// last height of the current chain must be sent in request @@ -107,6 +116,7 @@ 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 { /// Since: cosmos-sdk 0.43 @@ -117,6 +127,7 @@ pub struct QueryUpgradedConsensusStateResponse { /// RPC method. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsRequest { /// module_name is a field to query a specific module @@ -129,6 +140,7 @@ pub struct QueryModuleVersionsRequest { /// RPC method. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsResponse { /// module_versions is a list of module names with their consensus versions. @@ -138,11 +150,13 @@ pub struct QueryModuleVersionsResponse { /// QueryAuthorityRequest is the request type for Query/Authority /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityRequest {} /// QueryAuthorityResponse is the response type for Query/Authority /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityResponse { #[prost(string, tag = "1")] @@ -151,6 +165,7 @@ pub struct QueryAuthorityResponse { /// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgrade { /// authority is the address of the governance account. @@ -163,11 +178,13 @@ pub struct MsgSoftwareUpgrade { /// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgradeResponse {} /// MsgCancelUpgrade is the Msg/CancelUpgrade request type. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgrade { /// authority is the address of the governance account. @@ -177,7 +194,9 @@ pub struct MsgCancelUpgrade { /// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgradeResponse {} +include!("cosmos.upgrade.v1beta1.serde.rs"); include!("cosmos.upgrade.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..0dd6e6aa --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.serde.rs @@ -0,0 +1,1945 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for CancelSoftwareUpgradeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CancelSoftwareUpgradeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["title", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ModuleVersion { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.version != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.ModuleVersion", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if self.version != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleVersion { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "version"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Version, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.ModuleVersion") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelUpgrade { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgCancelUpgrade", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelUpgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgCancelUpgrade") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelUpgradeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelUpgradeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgCancelUpgradeResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSoftwareUpgrade { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if self.plan.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.MsgSoftwareUpgrade", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSoftwareUpgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "plan"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Plan, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgSoftwareUpgrade") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSoftwareUpgradeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSoftwareUpgradeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.MsgSoftwareUpgradeResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Plan { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if self.time.is_some() { + len += 1; + } + if self.height != 0 { + len += 1; + } + if !self.info.is_empty() { + len += 1; + } + if self.upgraded_client_state.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.upgrade.v1beta1.Plan", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if let Some(v) = self.time.as_ref() { + struct_ser.serialize_field("time", v)?; + } + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if !self.info.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Plan { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.Plan") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAppliedPlanRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanRequest", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAppliedPlanRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAppliedPlanRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAppliedPlanResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAppliedPlanResponse", len)?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAppliedPlanResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAppliedPlanResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAuthorityRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAuthorityRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAuthorityRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAuthorityResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.QueryAuthorityResponse", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAuthorityResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryAuthorityResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCurrentPlanRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCurrentPlanRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryCurrentPlanRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCurrentPlanResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.plan.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCurrentPlanResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["plan"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Plan, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryCurrentPlanResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryModuleVersionsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.module_name.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsRequest", len)?; + if !self.module_name.is_empty() { + struct_ser.serialize_field("moduleName", &self.module_name)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryModuleVersionsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["module_name", "moduleName"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleName, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryModuleVersionsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryModuleVersionsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.module_versions.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.upgrade.v1beta1.QueryModuleVersionsResponse", len)?; + if !self.module_versions.is_empty() { + struct_ser.serialize_field("moduleVersions", &self.module_versions)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryModuleVersionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["module_versions", "moduleVersions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleVersions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.QueryModuleVersionsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradedConsensusStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.last_height != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest", + len, + )?; + if self.last_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "lastHeight", + ToString::to_string(&self.last_height).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["last_height", "lastHeight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + LastHeight, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradedConsensusStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.upgraded_consensus_state.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse", + len, + )?; + if !self.upgraded_consensus_state.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "upgradedConsensusState", + pbjson::private::base64::encode(&self.upgraded_consensus_state).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["upgraded_consensus_state", "upgradedConsensusState"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UpgradedConsensusState, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SoftwareUpgradeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if self.plan.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.upgrade.v1beta1.SoftwareUpgradeProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SoftwareUpgradeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["title", "description", "plan"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Plan, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.upgrade.v1beta1.SoftwareUpgradeProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs index 63a56aeb..41bba608 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 @@ -1,6 +1,7 @@ // @generated /// BaseVestingAccount implements the VestingAccount interface. It contains all /// the necessary fields needed for any vesting account implementation. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BaseVestingAccount { #[prost(message, optional, tag = "1")] @@ -17,6 +18,7 @@ pub struct BaseVestingAccount { } /// ContinuousVestingAccount implements the VestingAccount interface. It /// continuously vests by unlocking coins linearly with respect to time. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContinuousVestingAccount { #[prost(message, optional, tag = "1")] @@ -28,12 +30,14 @@ pub struct ContinuousVestingAccount { /// DelayedVestingAccount implements the VestingAccount interface. It vests all /// coins after a specific time, but non prior. In other words, it keeps them /// locked until a specified time. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelayedVestingAccount { #[prost(message, optional, tag = "1")] pub base_vesting_account: ::core::option::Option, } /// Period defines a length of time and amount of coins that will vest. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Period { /// Period duration in seconds. @@ -44,6 +48,7 @@ pub struct Period { } /// PeriodicVestingAccount implements the VestingAccount interface. It /// periodically vests by unlocking coins during each specified period. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PeriodicVestingAccount { #[prost(message, optional, tag = "1")] @@ -58,6 +63,7 @@ pub struct PeriodicVestingAccount { /// still be used for delegating and for governance votes even while locked. /// /// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PermanentLockedAccount { #[prost(message, optional, tag = "1")] @@ -65,6 +71,7 @@ pub struct PermanentLockedAccount { } /// MsgCreateVestingAccount defines a message that enables creating a vesting /// account. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateVestingAccount { #[prost(string, tag = "1")] @@ -80,12 +87,14 @@ pub struct MsgCreateVestingAccount { pub delayed: bool, } /// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateVestingAccountResponse {} /// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent /// locked account. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePermanentLockedAccount { #[prost(string, tag = "1")] @@ -98,12 +107,14 @@ pub struct MsgCreatePermanentLockedAccount { /// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePermanentLockedAccountResponse {} /// MsgCreateVestingAccount defines a message that enables creating a vesting /// account. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePeriodicVestingAccount { #[prost(string, tag = "1")] @@ -120,7 +131,9 @@ pub struct MsgCreatePeriodicVestingAccount { /// response type. /// /// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePeriodicVestingAccountResponse {} +include!("cosmos.vesting.v1beta1.serde.rs"); include!("cosmos.vesting.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) 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..9e6e285b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.serde.rs @@ -0,0 +1,1547 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for BaseVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_account.is_some() { + len += 1; + } + if !self.original_vesting.is_empty() { + len += 1; + } + if !self.delegated_free.is_empty() { + len += 1; + } + if !self.delegated_vesting.is_empty() { + len += 1; + } + if self.end_time != 0 { + 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 !self.original_vesting.is_empty() { + struct_ser.serialize_field("originalVesting", &self.original_vesting)?; + } + if !self.delegated_free.is_empty() { + struct_ser.serialize_field("delegatedFree", &self.delegated_free)?; + } + if !self.delegated_vesting.is_empty() { + struct_ser.serialize_field("delegatedVesting", &self.delegated_vesting)?; + } + if self.end_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endTime", ToString::to_string(&self.end_time).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for BaseVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.BaseVestingAccount") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ContinuousVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_vesting_account.is_some() { + len += 1; + } + if self.start_time != 0 { + 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 self.start_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("startTime", ToString::to_string(&self.start_time).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ContinuousVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.ContinuousVestingAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DelayedVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_vesting_account.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DelayedVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["base_vesting_account", "baseVestingAccount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseVestingAccount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.DelayedVestingAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreatePeriodicVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.from_address.is_empty() { + len += 1; + } + if !self.to_address.is_empty() { + len += 1; + } + if self.start_time != 0 { + len += 1; + } + if !self.vesting_periods.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount", + len, + )?; + if !self.from_address.is_empty() { + struct_ser.serialize_field("fromAddress", &self.from_address)?; + } + if !self.to_address.is_empty() { + struct_ser.serialize_field("toAddress", &self.to_address)?; + } + if self.start_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("startTime", ToString::to_string(&self.start_time).as_str())?; + } + if !self.vesting_periods.is_empty() { + struct_ser.serialize_field("vestingPeriods", &self.vesting_periods)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreatePeriodicVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreatePeriodicVestingAccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreatePeriodicVestingAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreatePermanentLockedAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.from_address.is_empty() { + len += 1; + } + if !self.to_address.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount", + len, + )?; + if !self.from_address.is_empty() { + struct_ser.serialize_field("fromAddress", &self.from_address)?; + } + if !self.to_address.is_empty() { + struct_ser.serialize_field("toAddress", &self.to_address)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreatePermanentLockedAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreatePermanentLockedAccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreatePermanentLockedAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.from_address.is_empty() { + len += 1; + } + if !self.to_address.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + if self.end_time != 0 { + len += 1; + } + if self.delayed { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.vesting.v1beta1.MsgCreateVestingAccount", len)?; + if !self.from_address.is_empty() { + struct_ser.serialize_field("fromAddress", &self.from_address)?; + } + if !self.to_address.is_empty() { + struct_ser.serialize_field("toAddress", &self.to_address)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + if self.end_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("endTime", ToString::to_string(&self.end_time).as_str())?; + } + if self.delayed { + struct_ser.serialize_field("delayed", &self.delayed)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreateVestingAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateVestingAccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateVestingAccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Period { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.length != 0 { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.vesting.v1beta1.Period", len)?; + if self.length != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("length", ToString::to_string(&self.length).as_str())?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Period { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["length", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Length, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.Period") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PeriodicVestingAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_vesting_account.is_some() { + len += 1; + } + if self.start_time != 0 { + len += 1; + } + if !self.vesting_periods.is_empty() { + 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 self.start_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("startTime", ToString::to_string(&self.start_time).as_str())?; + } + if !self.vesting_periods.is_empty() { + struct_ser.serialize_field("vestingPeriods", &self.vesting_periods)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PeriodicVestingAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.PeriodicVestingAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PermanentLockedAccount { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.base_vesting_account.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PermanentLockedAccount { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["base_vesting_account", "baseVestingAccount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BaseVestingAccount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.vesting.v1beta1.PermanentLockedAccount") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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/cosmos-sdk/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs index a74f2b1e..2353a154 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs @@ -1,6 +1,7 @@ // @generated /// InterfaceDescriptor describes an interface type to be used with /// accepts_interface and implements_interface and declared by declare_interface. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceDescriptor { /// name is the name of the interface. It should be a short-name (without @@ -21,6 +22,7 @@ pub struct InterfaceDescriptor { /// Scalars should ideally define an encoding such that there is only one /// valid syntactical representation for a given semantic meaning, /// i.e. the encoding should be deterministic. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScalarDescriptor { /// name is the name of the scalar. It should be a short-name (without @@ -60,5 +62,15 @@ impl ScalarType { ScalarType::Bytes => "SCALAR_TYPE_BYTES", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SCALAR_TYPE_STRING" => Some(Self::String), + "SCALAR_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } } +include!("cosmos_proto.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.serde.rs new file mode 100644 index 00000000..0ebdf0ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.serde.rs @@ -0,0 +1,334 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos_proto.InterfaceDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "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 = InterfaceDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(InterfaceDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos_proto.InterfaceDescriptor", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.field_type.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos_proto.ScalarDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.field_type.is_empty() { + let v = self + .field_type + .iter() + .cloned() + .map(|v| { + ScalarType::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }) + .collect::, _>>()?; + struct_ser.serialize_field("fieldType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description", "field_type", "fieldType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + FieldType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + "fieldType" | "field_type" => Ok(GeneratedField::FieldType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.ScalarDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + let mut field_type__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::FieldType => { + if field_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldType")); + } + field_type__ = Some( + map_.next_value::>()? + .into_iter() + .map(|x| x as i32) + .collect(), + ); + } + } + } + Ok(ScalarDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + field_type: field_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos_proto.ScalarDescriptor", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCALAR_TYPE_UNSPECIFIED", + "SCALAR_TYPE_STRING", + "SCALAR_TYPE_BYTES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Ok(ScalarType::Unspecified), + "SCALAR_TYPE_STRING" => Ok(ScalarType::String), + "SCALAR_TYPE_BYTES" => Ok(ScalarType::Bytes), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} 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 index 35d4edb8..272e77e9 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// BaseAccount defines a base account type. It contains all the necessary fields /// for basic account functionality. Any custom account type should extend this /// type for additional functionality (e.g. vesting). @@ -7,7 +8,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<::tendermint_proto::google::protobuf::Any>, #[prost(uint64, tag = "3")] pub account_number: u64, #[prost(uint64, tag = "4")] @@ -17,7 +18,10 @@ impl ::prost::Name for BaseAccount { const NAME: &'static str = "BaseAccount"; const PACKAGE: &'static str = "cosmos.auth.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + "cosmos.auth.v1beta1.BaseAccount".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.auth.v1beta1.BaseAccount".into() } } /// ModuleAccount defines an account for modules that holds coins on a pool. @@ -35,12 +39,15 @@ impl ::prost::Name for ModuleAccount { const NAME: &'static str = "ModuleAccount"; const PACKAGE: &'static str = "cosmos.auth.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + "cosmos.auth.v1beta1.ModuleAccount".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.auth.v1beta1.ModuleAccount".into() } } /// Params defines the parameters for the auth module. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { #[prost(uint64, tag = "1")] pub max_memo_characters: u64, @@ -57,6 +64,9 @@ impl ::prost::Name for Params { const NAME: &'static str = "Params"; const PACKAGE: &'static str = "cosmos.auth.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + "cosmos.auth.v1beta1.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.auth.v1beta1.Params".into() } } 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 index 58314ebc..67f3f8c6 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// PageRequest is to be embedded in gRPC request messages for efficient /// pagination. Ex: /// @@ -33,7 +34,10 @@ impl ::prost::Name for PageRequest { const NAME: &'static str = "PageRequest"; const PACKAGE: &'static str = "cosmos.base.query.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.query.v1beta1.{}", Self::NAME) + "cosmos.base.query.v1beta1.PageRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.base.query.v1beta1.PageRequest".into() } } /// PageResponse is to be embedded in gRPC response messages where the @@ -59,6 +63,9 @@ impl ::prost::Name for PageResponse { const NAME: &'static str = "PageResponse"; const PACKAGE: &'static str = "cosmos.base.query.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.query.v1beta1.{}", Self::NAME) + "cosmos.base.query.v1beta1.PageResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.base.query.v1beta1.PageResponse".into() } } 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 index e3497310..057afb09 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// Coin defines a token with a denomination and an amount. /// /// NOTE: The amount field is an Int which implements the custom method @@ -14,7 +15,10 @@ impl ::prost::Name for Coin { const NAME: &'static str = "Coin"; const PACKAGE: &'static str = "cosmos.base.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + "cosmos.base.v1beta1.Coin".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.base.v1beta1.Coin".into() } } /// DecCoin defines a token with a denomination and a decimal amount. @@ -33,7 +37,10 @@ impl ::prost::Name for DecCoin { const NAME: &'static str = "DecCoin"; const PACKAGE: &'static str = "cosmos.base.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + "cosmos.base.v1beta1.DecCoin".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.base.v1beta1.DecCoin".into() } } /// IntProto defines a Protobuf wrapper around an Int object. @@ -47,7 +54,10 @@ impl ::prost::Name for IntProto { const NAME: &'static str = "IntProto"; const PACKAGE: &'static str = "cosmos.base.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + "cosmos.base.v1beta1.IntProto".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.base.v1beta1.IntProto".into() } } /// DecProto defines a Protobuf wrapper around a Dec object. @@ -61,6 +71,9 @@ impl ::prost::Name for DecProto { const NAME: &'static str = "DecProto"; const PACKAGE: &'static str = "cosmos.base.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.v1beta1.{}", Self::NAME) + "cosmos.base.v1beta1.DecProto".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.base.v1beta1.DecProto".into() } } 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 index dd2af2f7..4761274d 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// Plan specifies information about a planned upgrade and when it should occur. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -14,7 +15,7 @@ pub struct Plan { /// 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>, + pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// The height at which the upgrade must be performed. /// Only used if Time is not set. #[prost(int64, tag = "3")] @@ -28,7 +29,10 @@ impl ::prost::Name for Plan { const NAME: &'static str = "Plan"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + "cosmos.upgrade.v1beta1.Plan".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.upgrade.v1beta1.Plan".into() } } /// SoftwareUpgradeProposal is a gov Content type for initiating a software @@ -47,7 +51,10 @@ impl ::prost::Name for SoftwareUpgradeProposal { const NAME: &'static str = "SoftwareUpgradeProposal"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + "cosmos.upgrade.v1beta1.SoftwareUpgradeProposal".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal".into() } } /// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software @@ -64,6 +71,9 @@ impl ::prost::Name for CancelSoftwareUpgradeProposal { const NAME: &'static str = "CancelSoftwareUpgradeProposal"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + "cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal".into() } } 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 index fc059366..9c803a1c 100644 --- 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 @@ -1,7 +1,8 @@ +// This file is @generated by prost-build. /// 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)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { /// controller_enabled enables or disables the controller submodule. #[prost(bool, tag = "1")] @@ -11,29 +12,29 @@ impl ::prost::Name for Params { const NAME: &'static str = "Params"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.controller.v1.{}", - Self::NAME - ) + "ibc.applications.interchain_accounts.controller.v1.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.controller.v1.Params".into() } } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.controller.v1.{}", - Self::NAME - ) + "ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.controller.v1.QueryParamsRequest".into() } } /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] @@ -43,10 +44,10 @@ impl ::prost::Name for QueryParamsResponse { const NAME: &'static str = "QueryParamsResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.controller.v1.{}", - Self::NAME - ) + "ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.controller.v1.QueryParamsResponse".into() } } /// Generated client implementations. 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 index 4ce4090c..e06818ed 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// 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)] @@ -14,24 +15,24 @@ impl ::prost::Name for Params { const NAME: &'static str = "Params"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.host.v1.{}", - Self::NAME - ) + "ibc.applications.interchain_accounts.host.v1.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.host.v1.Params".into() } } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.host.v1.{}", - Self::NAME - ) + "ibc.applications.interchain_accounts.host.v1.QueryParamsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest".into() } } /// QueryParamsResponse is the response type for the Query/Params RPC method. @@ -46,10 +47,10 @@ impl ::prost::Name for QueryParamsResponse { const NAME: &'static str = "QueryParamsResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.host.v1.{}", - Self::NAME - ) + "ibc.applications.interchain_accounts.host.v1.QueryParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse".into() } } /// Generated client implementations. 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 index fa4a0ef3..5c5ccf17 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// 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)] @@ -12,7 +13,10 @@ impl ::prost::Name for InterchainAccount { const NAME: &'static str = "InterchainAccount"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.InterchainAccount".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.InterchainAccount".into() } } /// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. @@ -30,7 +34,10 @@ impl ::prost::Name for InterchainAccountPacketData { const NAME: &'static str = "InterchainAccountPacketData"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.InterchainAccountPacketData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.InterchainAccountPacketData".into() } } /// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. @@ -38,13 +45,16 @@ impl ::prost::Name for InterchainAccountPacketData { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CosmosTx { #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + pub messages: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for CosmosTx { const NAME: &'static str = "CosmosTx"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.CosmosTx".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.CosmosTx".into() } } /// Type defines a classification of message issued from a controller chain to its associated interchain accounts @@ -106,7 +116,10 @@ impl ::prost::Name for Metadata { const NAME: &'static str = "Metadata"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.Metadata".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.Metadata".into() } } /// GenesisState defines the interchain accounts genesis state @@ -122,7 +135,10 @@ impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.GenesisState".into() } } /// ControllerGenesisState defines the interchain accounts controller genesis state @@ -142,7 +158,10 @@ impl ::prost::Name for ControllerGenesisState { const NAME: &'static str = "ControllerGenesisState"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.ControllerGenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.ControllerGenesisState".into() } } /// HostGenesisState defines the interchain accounts host genesis state @@ -162,7 +181,10 @@ impl ::prost::Name for HostGenesisState { const NAME: &'static str = "HostGenesisState"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.HostGenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.HostGenesisState".into() } } /// ActiveChannel contains a connection ID, port ID and associated active channel ID @@ -180,7 +202,10 @@ impl ::prost::Name for ActiveChannel { const NAME: &'static str = "ActiveChannel"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.ActiveChannel".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.ActiveChannel".into() } } /// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address @@ -198,6 +223,9 @@ impl ::prost::Name for RegisteredInterchainAccount { const NAME: &'static str = "RegisteredInterchainAccount"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + "ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.interchain_accounts.v1.RegisteredInterchainAccount".into() } } 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 index 7bd0ad00..757758f3 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between /// ICS20 enabled chains. See ICS Spec here: /// @@ -32,18 +33,24 @@ impl ::prost::Name for MsgTransfer { const NAME: &'static str = "MsgTransfer"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.MsgTransfer".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.MsgTransfer".into() } } /// MsgTransferResponse defines the Msg/Transfer response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgTransferResponse {} impl ::prost::Name for MsgTransferResponse { const NAME: &'static str = "MsgTransferResponse"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.MsgTransferResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.MsgTransferResponse".into() } } /// Generated client implementations. @@ -171,7 +178,10 @@ impl ::prost::Name for DenomTrace { const NAME: &'static str = "DenomTrace"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.DenomTrace".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.DenomTrace".into() } } /// Params defines the set of IBC transfer parameters. @@ -179,7 +189,7 @@ impl ::prost::Name for DenomTrace { /// 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)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Params { /// send_enabled enables or disables all cross-chain token transfers from this /// chain. @@ -194,7 +204,10 @@ impl ::prost::Name for Params { const NAME: &'static str = "Params"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.Params".into() } } /// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC @@ -210,7 +223,10 @@ impl ::prost::Name for QueryDenomTraceRequest { const NAME: &'static str = "QueryDenomTraceRequest"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryDenomTraceRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryDenomTraceRequest".into() } } /// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC @@ -226,7 +242,10 @@ impl ::prost::Name for QueryDenomTraceResponse { const NAME: &'static str = "QueryDenomTraceResponse"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryDenomTraceResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryDenomTraceResponse".into() } } /// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC @@ -244,7 +263,10 @@ impl ::prost::Name for QueryDenomTracesRequest { const NAME: &'static str = "QueryDenomTracesRequest"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryDenomTracesRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryDenomTracesRequest".into() } } /// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC @@ -265,23 +287,29 @@ impl ::prost::Name for QueryDenomTracesResponse { const NAME: &'static str = "QueryDenomTracesResponse"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryDenomTracesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryDenomTracesResponse".into() } } /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsRequest {} impl ::prost::Name for QueryParamsRequest { const NAME: &'static str = "QueryParamsRequest"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryParamsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryParamsRequest".into() } } /// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] @@ -291,7 +319,10 @@ impl ::prost::Name for QueryParamsResponse { const NAME: &'static str = "QueryParamsResponse"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryParamsResponse".into() } } /// QueryDenomHashRequest is the request type for the Query/DenomHash RPC @@ -307,7 +338,10 @@ impl ::prost::Name for QueryDenomHashRequest { const NAME: &'static str = "QueryDenomHashRequest"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryDenomHashRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryDenomHashRequest".into() } } /// QueryDenomHashResponse is the response type for the Query/DenomHash RPC @@ -323,7 +357,10 @@ impl ::prost::Name for QueryDenomHashResponse { const NAME: &'static str = "QueryDenomHashResponse"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.QueryDenomHashResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.QueryDenomHashResponse".into() } } /// Generated client implementations. @@ -521,6 +558,9 @@ impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + "ibc.applications.transfer.v1.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v1.GenesisState".into() } } 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 index a7024f2f..16f58976 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// FungibleTokenPacketData defines a struct for the packet payload /// See FungibleTokenPacketData spec: /// @@ -21,6 +22,9 @@ impl ::prost::Name for FungibleTokenPacketData { const NAME: &'static str = "FungibleTokenPacketData"; const PACKAGE: &'static str = "ibc.applications.transfer.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v2.{}", Self::NAME) + "ibc.applications.transfer.v2.FungibleTokenPacketData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.applications.transfer.v2.FungibleTokenPacketData".into() } } 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 index ae0e4254..ba965aa4 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// 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. @@ -25,7 +26,10 @@ impl ::prost::Name for Channel { const NAME: &'static str = "Channel"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.Channel".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.Channel".into() } } /// IdentifiedChannel defines a channel with additional port and channel @@ -60,7 +64,10 @@ impl ::prost::Name for IdentifiedChannel { const NAME: &'static str = "IdentifiedChannel"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.IdentifiedChannel".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.IdentifiedChannel".into() } } /// Counterparty defines a channel end counterparty @@ -78,7 +85,10 @@ impl ::prost::Name for Counterparty { const NAME: &'static str = "Counterparty"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.Counterparty".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.Counterparty".into() } } /// Packet defines a type that carries data across different chains through IBC @@ -116,7 +126,10 @@ impl ::prost::Name for Packet { const NAME: &'static str = "Packet"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.Packet".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.Packet".into() } } /// PacketState defines the generic type necessary to retrieve and store @@ -143,7 +156,10 @@ impl ::prost::Name for PacketState { const NAME: &'static str = "PacketState"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.PacketState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.PacketState".into() } } /// Acknowledgement is the recommended acknowledgement format to be used by @@ -176,7 +192,10 @@ impl ::prost::Name for Acknowledgement { const NAME: &'static str = "Acknowledgement"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.Acknowledgement".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.Acknowledgement".into() } } /// State defines if a channel is in one of the following states: @@ -273,7 +292,10 @@ impl ::prost::Name for MsgChannelOpenInit { const NAME: &'static str = "MsgChannelOpenInit"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenInit".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenInit".into() } } /// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. @@ -287,7 +309,10 @@ impl ::prost::Name for MsgChannelOpenInitResponse { const NAME: &'static str = "MsgChannelOpenInitResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenInitResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenInitResponse".into() } } /// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel @@ -318,18 +343,24 @@ impl ::prost::Name for MsgChannelOpenTry { const NAME: &'static str = "MsgChannelOpenTry"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenTry".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenTry".into() } } /// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgChannelOpenTryResponse {} impl ::prost::Name for MsgChannelOpenTryResponse { const NAME: &'static str = "MsgChannelOpenTryResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenTryResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenTryResponse".into() } } /// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge @@ -356,18 +387,24 @@ impl ::prost::Name for MsgChannelOpenAck { const NAME: &'static str = "MsgChannelOpenAck"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenAck".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenAck".into() } } /// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAckResponse {} impl ::prost::Name for MsgChannelOpenAckResponse { const NAME: &'static str = "MsgChannelOpenAckResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenAckResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenAckResponse".into() } } /// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to @@ -390,19 +427,25 @@ impl ::prost::Name for MsgChannelOpenConfirm { const NAME: &'static str = "MsgChannelOpenConfirm"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenConfirm".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenConfirm".into() } } /// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response /// type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgChannelOpenConfirmResponse {} impl ::prost::Name for MsgChannelOpenConfirmResponse { const NAME: &'static str = "MsgChannelOpenConfirmResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelOpenConfirmResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelOpenConfirmResponse".into() } } /// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A @@ -421,18 +464,24 @@ impl ::prost::Name for MsgChannelCloseInit { const NAME: &'static str = "MsgChannelCloseInit"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelCloseInit".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelCloseInit".into() } } /// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgChannelCloseInitResponse {} impl ::prost::Name for MsgChannelCloseInitResponse { const NAME: &'static str = "MsgChannelCloseInitResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelCloseInitResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelCloseInitResponse".into() } } /// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B @@ -455,19 +504,25 @@ impl ::prost::Name for MsgChannelCloseConfirm { const NAME: &'static str = "MsgChannelCloseConfirm"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelCloseConfirm".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelCloseConfirm".into() } } /// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response /// type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgChannelCloseConfirmResponse {} impl ::prost::Name for MsgChannelCloseConfirmResponse { const NAME: &'static str = "MsgChannelCloseConfirmResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgChannelCloseConfirmResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse".into() } } /// MsgRecvPacket receives incoming IBC packet @@ -487,12 +542,15 @@ impl ::prost::Name for MsgRecvPacket { const NAME: &'static str = "MsgRecvPacket"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgRecvPacket".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgRecvPacket".into() } } /// MsgRecvPacketResponse defines the Msg/RecvPacket response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgRecvPacketResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, @@ -501,7 +559,10 @@ impl ::prost::Name for MsgRecvPacketResponse { const NAME: &'static str = "MsgRecvPacketResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgRecvPacketResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgRecvPacketResponse".into() } } /// MsgTimeout receives timed-out packet @@ -523,12 +584,15 @@ impl ::prost::Name for MsgTimeout { const NAME: &'static str = "MsgTimeout"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgTimeout".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgTimeout".into() } } /// MsgTimeoutResponse defines the Msg/Timeout response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgTimeoutResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, @@ -537,7 +601,10 @@ impl ::prost::Name for MsgTimeoutResponse { const NAME: &'static str = "MsgTimeoutResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgTimeoutResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgTimeoutResponse".into() } } /// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. @@ -561,12 +628,15 @@ impl ::prost::Name for MsgTimeoutOnClose { const NAME: &'static str = "MsgTimeoutOnClose"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgTimeoutOnClose".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgTimeoutOnClose".into() } } /// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgTimeoutOnCloseResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, @@ -575,7 +645,10 @@ impl ::prost::Name for MsgTimeoutOnCloseResponse { const NAME: &'static str = "MsgTimeoutOnCloseResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgTimeoutOnCloseResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgTimeoutOnCloseResponse".into() } } /// MsgAcknowledgement receives incoming IBC acknowledgement @@ -597,12 +670,15 @@ impl ::prost::Name for MsgAcknowledgement { const NAME: &'static str = "MsgAcknowledgement"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgAcknowledgement".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgAcknowledgement".into() } } /// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgAcknowledgementResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, @@ -611,7 +687,10 @@ impl ::prost::Name for MsgAcknowledgementResponse { const NAME: &'static str = "MsgAcknowledgementResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.MsgAcknowledgementResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgAcknowledgementResponse".into() } } /// ResponseResultType defines the possible outcomes of the execution of a message @@ -960,7 +1039,10 @@ impl ::prost::Name for QueryChannelRequest { const NAME: &'static str = "QueryChannelRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelRequest".into() } } /// QueryChannelResponse is the response type for the Query/Channel RPC method. @@ -983,7 +1065,10 @@ impl ::prost::Name for QueryChannelResponse { const NAME: &'static str = "QueryChannelResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelResponse".into() } } /// QueryChannelsRequest is the request type for the Query/Channels RPC method @@ -1000,7 +1085,10 @@ impl ::prost::Name for QueryChannelsRequest { const NAME: &'static str = "QueryChannelsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelsRequest".into() } } /// QueryChannelsResponse is the response type for the Query/Channels RPC method. @@ -1023,7 +1111,10 @@ impl ::prost::Name for QueryChannelsResponse { const NAME: &'static str = "QueryChannelsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelsResponse".into() } } /// QueryConnectionChannelsRequest is the request type for the @@ -1044,7 +1135,10 @@ impl ::prost::Name for QueryConnectionChannelsRequest { const NAME: &'static str = "QueryConnectionChannelsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryConnectionChannelsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryConnectionChannelsRequest".into() } } /// QueryConnectionChannelsResponse is the Response type for the @@ -1068,7 +1162,10 @@ impl ::prost::Name for QueryConnectionChannelsResponse { const NAME: &'static str = "QueryConnectionChannelsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryConnectionChannelsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryConnectionChannelsResponse".into() } } /// QueryChannelClientStateRequest is the request type for the Query/ClientState @@ -1087,7 +1184,10 @@ impl ::prost::Name for QueryChannelClientStateRequest { const NAME: &'static str = "QueryChannelClientStateRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelClientStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelClientStateRequest".into() } } /// QueryChannelClientStateResponse is the Response type for the @@ -1110,7 +1210,10 @@ impl ::prost::Name for QueryChannelClientStateResponse { const NAME: &'static str = "QueryChannelClientStateResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelClientStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelClientStateResponse".into() } } /// QueryChannelConsensusStateRequest is the request type for the @@ -1135,7 +1238,10 @@ impl ::prost::Name for QueryChannelConsensusStateRequest { const NAME: &'static str = "QueryChannelConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelConsensusStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelConsensusStateRequest".into() } } /// QueryChannelClientStateResponse is the Response type for the @@ -1145,7 +1251,7 @@ impl ::prost::Name for QueryChannelConsensusStateRequest { pub struct QueryChannelConsensusStateResponse { /// consensus state associated with the channel #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// client ID associated with the consensus state #[prost(string, tag = "2")] pub client_id: ::prost::alloc::string::String, @@ -1160,7 +1266,10 @@ impl ::prost::Name for QueryChannelConsensusStateResponse { const NAME: &'static str = "QueryChannelConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryChannelConsensusStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryChannelConsensusStateResponse".into() } } /// QueryPacketCommitmentRequest is the request type for the @@ -1182,7 +1291,10 @@ impl ::prost::Name for QueryPacketCommitmentRequest { const NAME: &'static str = "QueryPacketCommitmentRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketCommitmentRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketCommitmentRequest".into() } } /// QueryPacketCommitmentResponse defines the client query response for a packet @@ -1205,7 +1317,10 @@ impl ::prost::Name for QueryPacketCommitmentResponse { const NAME: &'static str = "QueryPacketCommitmentResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketCommitmentResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketCommitmentResponse".into() } } /// QueryPacketCommitmentsRequest is the request type for the @@ -1229,7 +1344,10 @@ impl ::prost::Name for QueryPacketCommitmentsRequest { const NAME: &'static str = "QueryPacketCommitmentsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketCommitmentsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketCommitmentsRequest".into() } } /// QueryPacketCommitmentsResponse is the request type for the @@ -1252,7 +1370,10 @@ impl ::prost::Name for QueryPacketCommitmentsResponse { const NAME: &'static str = "QueryPacketCommitmentsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketCommitmentsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketCommitmentsResponse".into() } } /// QueryPacketReceiptRequest is the request type for the @@ -1274,7 +1395,10 @@ impl ::prost::Name for QueryPacketReceiptRequest { const NAME: &'static str = "QueryPacketReceiptRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketReceiptRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketReceiptRequest".into() } } /// QueryPacketReceiptResponse defines the client query response for a packet @@ -1297,7 +1421,10 @@ impl ::prost::Name for QueryPacketReceiptResponse { const NAME: &'static str = "QueryPacketReceiptResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketReceiptResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketReceiptResponse".into() } } /// QueryPacketAcknowledgementRequest is the request type for the @@ -1319,7 +1446,10 @@ impl ::prost::Name for QueryPacketAcknowledgementRequest { const NAME: &'static str = "QueryPacketAcknowledgementRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketAcknowledgementRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketAcknowledgementRequest".into() } } /// QueryPacketAcknowledgementResponse defines the client query response for a @@ -1342,7 +1472,10 @@ impl ::prost::Name for QueryPacketAcknowledgementResponse { const NAME: &'static str = "QueryPacketAcknowledgementResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketAcknowledgementResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketAcknowledgementResponse".into() } } /// QueryPacketAcknowledgementsRequest is the request type for the @@ -1369,7 +1502,10 @@ impl ::prost::Name for QueryPacketAcknowledgementsRequest { const NAME: &'static str = "QueryPacketAcknowledgementsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest".into() } } /// QueryPacketAcknowledgemetsResponse is the request type for the @@ -1392,7 +1528,10 @@ impl ::prost::Name for QueryPacketAcknowledgementsResponse { const NAME: &'static str = "QueryPacketAcknowledgementsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse".into() } } /// QueryUnreceivedPacketsRequest is the request type for the @@ -1414,7 +1553,10 @@ impl ::prost::Name for QueryUnreceivedPacketsRequest { const NAME: &'static str = "QueryUnreceivedPacketsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryUnreceivedPacketsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryUnreceivedPacketsRequest".into() } } /// QueryUnreceivedPacketsResponse is the response type for the @@ -1433,7 +1575,10 @@ impl ::prost::Name for QueryUnreceivedPacketsResponse { const NAME: &'static str = "QueryUnreceivedPacketsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryUnreceivedPacketsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryUnreceivedPacketsResponse".into() } } /// QueryUnreceivedAcks is the request type for the @@ -1455,7 +1600,10 @@ impl ::prost::Name for QueryUnreceivedAcksRequest { const NAME: &'static str = "QueryUnreceivedAcksRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryUnreceivedAcksRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryUnreceivedAcksRequest".into() } } /// QueryUnreceivedAcksResponse is the response type for the @@ -1474,7 +1622,10 @@ impl ::prost::Name for QueryUnreceivedAcksResponse { const NAME: &'static str = "QueryUnreceivedAcksResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryUnreceivedAcksResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryUnreceivedAcksResponse".into() } } /// QueryNextSequenceReceiveRequest is the request type for the @@ -1493,7 +1644,10 @@ impl ::prost::Name for QueryNextSequenceReceiveRequest { const NAME: &'static str = "QueryNextSequenceReceiveRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryNextSequenceReceiveRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryNextSequenceReceiveRequest".into() } } /// QuerySequenceResponse is the request type for the @@ -1515,7 +1669,10 @@ impl ::prost::Name for QueryNextSequenceReceiveResponse { const NAME: &'static str = "QueryNextSequenceReceiveResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.QueryNextSequenceReceiveResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.QueryNextSequenceReceiveResponse".into() } } /// Generated client implementations. @@ -1945,7 +2102,10 @@ impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.GenesisState".into() } } /// PacketSequence defines the genesis type necessary to retrieve and store @@ -1964,6 +2124,9 @@ impl ::prost::Name for PacketSequence { const NAME: &'static str = "PacketSequence"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + "ibc.core.channel.v1.PacketSequence".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.PacketSequence".into() } } 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 index 18e98186..6e6b473a 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// IdentifiedClientState defines a client state with an additional client /// identifier field. #[allow(clippy::derive_partial_eq_without_eq)] @@ -8,13 +9,16 @@ pub struct IdentifiedClientState { pub client_id: ::prost::alloc::string::String, /// client state #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for IdentifiedClientState { const NAME: &'static str = "IdentifiedClientState"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.IdentifiedClientState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.IdentifiedClientState".into() } } /// ConsensusStateWithHeight defines a consensus state with an additional height @@ -27,13 +31,16 @@ pub struct ConsensusStateWithHeight { pub height: ::core::option::Option, /// consensus state #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for ConsensusStateWithHeight { const NAME: &'static str = "ConsensusStateWithHeight"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.ConsensusStateWithHeight".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.ConsensusStateWithHeight".into() } } /// ClientConsensusStates defines all the stored consensus states for a given @@ -52,7 +59,10 @@ impl ::prost::Name for ClientConsensusStates { const NAME: &'static str = "ClientConsensusStates"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.ClientConsensusStates".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.ClientConsensusStates".into() } } /// ClientUpdateProposal is a governance proposal. If it passes, the substitute @@ -80,7 +90,10 @@ impl ::prost::Name for ClientUpdateProposal { const NAME: &'static str = "ClientUpdateProposal"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.ClientUpdateProposal".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.ClientUpdateProposal".into() } } /// UpgradeProposal is a gov Content type for initiating an IBC breaking @@ -101,13 +114,16 @@ pub struct UpgradeProposal { /// 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>, + pub upgraded_client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for UpgradeProposal { const NAME: &'static str = "UpgradeProposal"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.UpgradeProposal".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.UpgradeProposal".into() } } /// Height is a monotonically increasing data type @@ -121,7 +137,7 @@ impl ::prost::Name for UpgradeProposal { /// height continues to be monitonically increasing even as the RevisionHeight /// gets reset #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Height { /// the revision that the client is currently on #[prost(uint64, tag = "1")] @@ -134,7 +150,10 @@ impl ::prost::Name for Height { const NAME: &'static str = "Height"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.Height".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.Height".into() } } /// Params defines the set of IBC light client parameters. @@ -149,7 +168,10 @@ impl ::prost::Name for Params { const NAME: &'static str = "Params"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.Params".into() } } /// MsgCreateClient defines a message to create an IBC client @@ -158,11 +180,11 @@ impl ::prost::Name for Params { pub struct MsgCreateClient { /// light client state #[prost(message, optional, tag = "1")] - pub client_state: ::core::option::Option<::prost_types::Any>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::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>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// signer address #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, @@ -171,18 +193,24 @@ impl ::prost::Name for MsgCreateClient { const NAME: &'static str = "MsgCreateClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgCreateClient".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgCreateClient".into() } } /// MsgCreateClientResponse defines the Msg/CreateClient response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgCreateClientResponse {} impl ::prost::Name for MsgCreateClientResponse { const NAME: &'static str = "MsgCreateClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgCreateClientResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgCreateClientResponse".into() } } /// MsgUpdateClient defines an sdk.Msg to update a IBC client state using @@ -195,7 +223,7 @@ pub struct MsgUpdateClient { 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>, + pub header: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// signer address #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, @@ -204,18 +232,24 @@ impl ::prost::Name for MsgUpdateClient { const NAME: &'static str = "MsgUpdateClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgUpdateClient".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgUpdateClient".into() } } /// MsgUpdateClientResponse defines the Msg/UpdateClient response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpdateClientResponse {} impl ::prost::Name for MsgUpdateClientResponse { const NAME: &'static str = "MsgUpdateClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgUpdateClientResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgUpdateClientResponse".into() } } /// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client @@ -228,11 +262,11 @@ pub struct MsgUpgradeClient { pub client_id: ::prost::alloc::string::String, /// upgraded client state #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::prost_types::Any>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::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>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// proof that old chain committed to new client #[prost(bytes = "vec", tag = "4")] pub proof_upgrade_client: ::prost::alloc::vec::Vec, @@ -247,18 +281,24 @@ impl ::prost::Name for MsgUpgradeClient { const NAME: &'static str = "MsgUpgradeClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgUpgradeClient".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgUpgradeClient".into() } } /// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgUpgradeClientResponse {} impl ::prost::Name for MsgUpgradeClientResponse { const NAME: &'static str = "MsgUpgradeClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgUpgradeClientResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgUpgradeClientResponse".into() } } /// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for @@ -271,7 +311,7 @@ pub struct MsgSubmitMisbehaviour { 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>, + pub misbehaviour: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// signer address #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, @@ -280,19 +320,25 @@ impl ::prost::Name for MsgSubmitMisbehaviour { const NAME: &'static str = "MsgSubmitMisbehaviour"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgSubmitMisbehaviour".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgSubmitMisbehaviour".into() } } /// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response /// type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviourResponse {} impl ::prost::Name for MsgSubmitMisbehaviourResponse { const NAME: &'static str = "MsgSubmitMisbehaviourResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.MsgSubmitMisbehaviourResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.MsgSubmitMisbehaviourResponse".into() } } /// Generated client implementations. @@ -474,7 +520,10 @@ impl ::prost::Name for QueryClientStateRequest { const NAME: &'static str = "QueryClientStateRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientStateRequest".into() } } /// QueryClientStateResponse is the response type for the Query/ClientState RPC @@ -485,7 +534,7 @@ impl ::prost::Name for QueryClientStateRequest { pub struct QueryClientStateResponse { /// client state associated with the request identifier #[prost(message, optional, tag = "1")] - pub client_state: ::core::option::Option<::prost_types::Any>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] pub proof: ::prost::alloc::vec::Vec, @@ -497,7 +546,10 @@ impl ::prost::Name for QueryClientStateResponse { const NAME: &'static str = "QueryClientStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientStateResponse".into() } } /// QueryClientStatesRequest is the request type for the Query/ClientStates RPC @@ -515,7 +567,10 @@ impl ::prost::Name for QueryClientStatesRequest { const NAME: &'static str = "QueryClientStatesRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientStatesRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientStatesRequest".into() } } /// QueryClientStatesResponse is the response type for the Query/ClientStates RPC @@ -536,7 +591,10 @@ impl ::prost::Name for QueryClientStatesResponse { const NAME: &'static str = "QueryClientStatesResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientStatesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientStatesResponse".into() } } /// QueryConsensusStateRequest is the request type for the Query/ConsensusState @@ -563,7 +621,10 @@ impl ::prost::Name for QueryConsensusStateRequest { const NAME: &'static str = "QueryConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryConsensusStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryConsensusStateRequest".into() } } /// QueryConsensusStateResponse is the response type for the Query/ConsensusState @@ -573,7 +634,7 @@ impl ::prost::Name for QueryConsensusStateRequest { 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>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] pub proof: ::prost::alloc::vec::Vec, @@ -585,7 +646,10 @@ impl ::prost::Name for QueryConsensusStateResponse { const NAME: &'static str = "QueryConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryConsensusStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryConsensusStateResponse".into() } } /// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates @@ -606,7 +670,10 @@ impl ::prost::Name for QueryConsensusStatesRequest { const NAME: &'static str = "QueryConsensusStatesRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryConsensusStatesRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryConsensusStatesRequest".into() } } /// QueryConsensusStatesResponse is the response type for the @@ -627,7 +694,10 @@ impl ::prost::Name for QueryConsensusStatesResponse { const NAME: &'static str = "QueryConsensusStatesResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryConsensusStatesResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryConsensusStatesResponse".into() } } /// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC @@ -643,7 +713,10 @@ impl ::prost::Name for QueryClientStatusRequest { const NAME: &'static str = "QueryClientStatusRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientStatusRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientStatusRequest".into() } } /// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC @@ -658,19 +731,25 @@ impl ::prost::Name for QueryClientStatusResponse { const NAME: &'static str = "QueryClientStatusResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientStatusResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientStatusResponse".into() } } /// QueryClientParamsRequest is the request type for the Query/ClientParams RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryClientParamsRequest {} impl ::prost::Name for QueryClientParamsRequest { const NAME: &'static str = "QueryClientParamsRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientParamsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientParamsRequest".into() } } /// QueryClientParamsResponse is the response type for the Query/ClientParams RPC @@ -686,19 +765,25 @@ impl ::prost::Name for QueryClientParamsResponse { const NAME: &'static str = "QueryClientParamsResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryClientParamsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryClientParamsResponse".into() } } /// QueryUpgradedClientStateRequest is the request type for the /// Query/UpgradedClientState RPC method #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryUpgradedClientStateRequest {} impl ::prost::Name for QueryUpgradedClientStateRequest { const NAME: &'static str = "QueryUpgradedClientStateRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryUpgradedClientStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryUpgradedClientStateRequest".into() } } /// QueryUpgradedClientStateResponse is the response type for the @@ -708,25 +793,31 @@ impl ::prost::Name for QueryUpgradedClientStateRequest { 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>, + pub upgraded_client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for QueryUpgradedClientStateResponse { const NAME: &'static str = "QueryUpgradedClientStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryUpgradedClientStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryUpgradedClientStateResponse".into() } } /// QueryUpgradedConsensusStateRequest is the request type for the /// Query/UpgradedConsensusState RPC method #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateRequest {} impl ::prost::Name for QueryUpgradedConsensusStateRequest { const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryUpgradedConsensusStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryUpgradedConsensusStateRequest".into() } } /// QueryUpgradedConsensusStateResponse is the response type for the @@ -736,13 +827,16 @@ impl ::prost::Name for QueryUpgradedConsensusStateRequest { 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>, + pub upgraded_consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for QueryUpgradedConsensusStateResponse { const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.QueryUpgradedConsensusStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryUpgradedConsensusStateResponse".into() } } /// Generated client implementations. @@ -1036,7 +1130,10 @@ impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.GenesisState".into() } } /// GenesisMetadata defines the genesis type for metadata that clients may return @@ -1055,7 +1152,10 @@ impl ::prost::Name for GenesisMetadata { const NAME: &'static str = "GenesisMetadata"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.GenesisMetadata".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.GenesisMetadata".into() } } /// IdentifiedGenesisMetadata has the client metadata with the corresponding @@ -1072,6 +1172,9 @@ impl ::prost::Name for IdentifiedGenesisMetadata { const NAME: &'static str = "IdentifiedGenesisMetadata"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + "ibc.core.client.v1.IdentifiedGenesisMetadata".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.IdentifiedGenesisMetadata".into() } } 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 index 1c0cc6ff..b528388c 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// 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)] @@ -10,7 +11,10 @@ impl ::prost::Name for MerkleRoot { const NAME: &'static str = "MerkleRoot"; const PACKAGE: &'static str = "ibc.core.commitment.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + "ibc.core.commitment.v1.MerkleRoot".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.commitment.v1.MerkleRoot".into() } } /// MerklePrefix is merkle path prefixed to the key. @@ -26,7 +30,10 @@ impl ::prost::Name for MerklePrefix { const NAME: &'static str = "MerklePrefix"; const PACKAGE: &'static str = "ibc.core.commitment.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + "ibc.core.commitment.v1.MerklePrefix".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.commitment.v1.MerklePrefix".into() } } /// MerklePath is the path used to verify commitment proofs, which can be an @@ -42,7 +49,10 @@ impl ::prost::Name for MerklePath { const NAME: &'static str = "MerklePath"; const PACKAGE: &'static str = "ibc.core.commitment.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + "ibc.core.commitment.v1.MerklePath".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.commitment.v1.MerklePath".into() } } /// MerkleProof is a wrapper type over a chain of CommitmentProofs. @@ -60,6 +70,9 @@ impl ::prost::Name for MerkleProof { const NAME: &'static str = "MerkleProof"; const PACKAGE: &'static str = "ibc.core.commitment.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.commitment.v1.{}", Self::NAME) + "ibc.core.commitment.v1.MerkleProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.commitment.v1.MerkleProof".into() } } 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 index 2a41cc77..1e97642f 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// ConnectionEnd defines a stateful object on a chain connected to another /// separate one. /// NOTE: there must only be 2 defined ConnectionEnds to establish @@ -28,7 +29,10 @@ impl ::prost::Name for ConnectionEnd { const NAME: &'static str = "ConnectionEnd"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.ConnectionEnd".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.ConnectionEnd".into() } } /// IdentifiedConnection defines a connection with additional connection @@ -60,7 +64,10 @@ impl ::prost::Name for IdentifiedConnection { const NAME: &'static str = "IdentifiedConnection"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.IdentifiedConnection".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.IdentifiedConnection".into() } } /// Counterparty defines the counterparty chain associated with a connection end. @@ -83,7 +90,10 @@ impl ::prost::Name for Counterparty { const NAME: &'static str = "Counterparty"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.Counterparty".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.Counterparty".into() } } /// ClientPaths define all the connection paths for a client state. @@ -98,7 +108,10 @@ impl ::prost::Name for ClientPaths { const NAME: &'static str = "ClientPaths"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.ClientPaths".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.ClientPaths".into() } } /// ConnectionPaths define all the connection paths for a given client state. @@ -116,7 +129,10 @@ impl ::prost::Name for ConnectionPaths { const NAME: &'static str = "ConnectionPaths"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.ConnectionPaths".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.ConnectionPaths".into() } } /// Version defines the versioning scheme used to negotiate the IBC verison in @@ -135,12 +151,15 @@ impl ::prost::Name for Version { const NAME: &'static str = "Version"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.Version".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.Version".into() } } /// Params defines the set of Connection parameters. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, 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 @@ -152,7 +171,10 @@ impl ::prost::Name for Params { const NAME: &'static str = "Params"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.Params".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.Params".into() } } /// State defines if a connection is in one of the following states: @@ -214,19 +236,25 @@ impl ::prost::Name for MsgConnectionOpenInit { const NAME: &'static str = "MsgConnectionOpenInit"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenInit".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenInit".into() } } /// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response /// type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInitResponse {} impl ::prost::Name for MsgConnectionOpenInitResponse { const NAME: &'static str = "MsgConnectionOpenInitResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenInitResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenInitResponse".into() } } /// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a @@ -241,7 +269,7 @@ pub struct MsgConnectionOpenTry { #[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>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(message, optional, tag = "4")] pub counterparty: ::core::option::Option, #[prost(uint64, tag = "5")] @@ -269,18 +297,24 @@ impl ::prost::Name for MsgConnectionOpenTry { const NAME: &'static str = "MsgConnectionOpenTry"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenTry".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenTry".into() } } /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTryResponse {} impl ::prost::Name for MsgConnectionOpenTryResponse { const NAME: &'static str = "MsgConnectionOpenTryResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenTryResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenTryResponse".into() } } /// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to @@ -295,7 +329,7 @@ pub struct MsgConnectionOpenAck { #[prost(message, optional, tag = "3")] pub version: ::core::option::Option, #[prost(message, optional, tag = "4")] - pub client_state: ::core::option::Option<::prost_types::Any>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(message, optional, tag = "5")] pub proof_height: ::core::option::Option, /// proof of the initialization the connection on Chain B: `UNITIALIZED -> @@ -317,18 +351,24 @@ impl ::prost::Name for MsgConnectionOpenAck { const NAME: &'static str = "MsgConnectionOpenAck"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenAck".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenAck".into() } } /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAckResponse {} impl ::prost::Name for MsgConnectionOpenAckResponse { const NAME: &'static str = "MsgConnectionOpenAckResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenAckResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenAckResponse".into() } } /// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to @@ -350,19 +390,25 @@ impl ::prost::Name for MsgConnectionOpenConfirm { const NAME: &'static str = "MsgConnectionOpenConfirm"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenConfirm".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenConfirm".into() } } /// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm /// response type. #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirmResponse {} impl ::prost::Name for MsgConnectionOpenConfirmResponse { const NAME: &'static str = "MsgConnectionOpenConfirmResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse".into() } } /// Generated client implementations. @@ -559,7 +605,10 @@ impl ::prost::Name for QueryConnectionRequest { const NAME: &'static str = "QueryConnectionRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionRequest".into() } } /// QueryConnectionResponse is the response type for the Query/Connection RPC @@ -582,7 +631,10 @@ impl ::prost::Name for QueryConnectionResponse { const NAME: &'static str = "QueryConnectionResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionResponse".into() } } /// QueryConnectionsRequest is the request type for the Query/Connections RPC @@ -599,7 +651,10 @@ impl ::prost::Name for QueryConnectionsRequest { const NAME: &'static str = "QueryConnectionsRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionsRequest".into() } } /// QueryConnectionsResponse is the response type for the Query/Connections RPC @@ -623,7 +678,10 @@ impl ::prost::Name for QueryConnectionsResponse { const NAME: &'static str = "QueryConnectionsResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionsResponse".into() } } /// QueryClientConnectionsRequest is the request type for the @@ -639,7 +697,10 @@ impl ::prost::Name for QueryClientConnectionsRequest { const NAME: &'static str = "QueryClientConnectionsRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryClientConnectionsRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryClientConnectionsRequest".into() } } /// QueryClientConnectionsResponse is the response type for the @@ -661,7 +722,10 @@ impl ::prost::Name for QueryClientConnectionsResponse { const NAME: &'static str = "QueryClientConnectionsResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryClientConnectionsResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryClientConnectionsResponse".into() } } /// QueryConnectionClientStateRequest is the request type for the @@ -677,7 +741,10 @@ impl ::prost::Name for QueryConnectionClientStateRequest { const NAME: &'static str = "QueryConnectionClientStateRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionClientStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionClientStateRequest".into() } } /// QueryConnectionClientStateResponse is the response type for the @@ -700,7 +767,10 @@ impl ::prost::Name for QueryConnectionClientStateResponse { const NAME: &'static str = "QueryConnectionClientStateResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionClientStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionClientStateResponse".into() } } /// QueryConnectionConsensusStateRequest is the request type for the @@ -720,7 +790,10 @@ impl ::prost::Name for QueryConnectionConsensusStateRequest { const NAME: &'static str = "QueryConnectionConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionConsensusStateRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest".into() } } /// QueryConnectionConsensusStateResponse is the response type for the @@ -730,7 +803,7 @@ impl ::prost::Name for QueryConnectionConsensusStateRequest { pub struct QueryConnectionConsensusStateResponse { /// consensus state associated with the channel #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option<::prost_types::Any>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// client ID associated with the consensus state #[prost(string, tag = "2")] pub client_id: ::prost::alloc::string::String, @@ -745,7 +818,10 @@ impl ::prost::Name for QueryConnectionConsensusStateResponse { const NAME: &'static str = "QueryConnectionConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.QueryConnectionConsensusStateResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse".into() } } /// Generated client implementations. @@ -977,6 +1053,9 @@ impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + "ibc.core.connection.v1.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.connection.v1.GenesisState".into() } } 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 index 06e4e3d3..0b2718c5 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// GenesisState defines the ibc module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -16,6 +17,9 @@ impl ::prost::Name for GenesisState { const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.core.types.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.types.v1.{}", Self::NAME) + "ibc.core.types.v1.GenesisState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.types.v1.GenesisState".into() } } 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 index 4fe8fe76..e5413e37 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// ClientState defines a loopback (localhost) client. It requires (read-only) /// access to keys outside the client prefix. #[allow(clippy::derive_partial_eq_without_eq)] @@ -14,6 +15,9 @@ impl ::prost::Name for ClientState { const NAME: &'static str = "ClientState"; const PACKAGE: &'static str = "ibc.lightclients.localhost.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.localhost.v1.{}", Self::NAME) + "ibc.lightclients.localhost.v1.ClientState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.localhost.v1.ClientState".into() } } 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 index f8ca6373..4c3e232e 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// 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)] @@ -20,7 +21,10 @@ impl ::prost::Name for ClientState { const NAME: &'static str = "ClientState"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.ClientState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.ClientState".into() } } /// ConsensusState defines a solo machine consensus state. The sequence of a @@ -31,7 +35,7 @@ impl ::prost::Name for ClientState { pub struct ConsensusState { /// public key of the solo machine #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// diversifier allows the same public key to be re-used across different solo /// machine clients (potentially on different chains) without being considered /// misbehaviour. @@ -44,7 +48,10 @@ impl ::prost::Name for ConsensusState { const NAME: &'static str = "ConsensusState"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.ConsensusState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.ConsensusState".into() } } /// Header defines a solo machine consensus header @@ -59,7 +66,7 @@ pub struct Header { #[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>, + pub new_public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(string, tag = "5")] pub new_diversifier: ::prost::alloc::string::String, } @@ -67,7 +74,10 @@ impl ::prost::Name for Header { const NAME: &'static str = "Header"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.Header".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.Header".into() } } /// Misbehaviour defines misbehaviour for a solo machine which consists @@ -88,7 +98,10 @@ impl ::prost::Name for Misbehaviour { const NAME: &'static str = "Misbehaviour"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.Misbehaviour".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.Misbehaviour".into() } } /// SignatureAndData contains a signature and the data signed over to create that @@ -109,7 +122,10 @@ impl ::prost::Name for SignatureAndData { const NAME: &'static str = "SignatureAndData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.SignatureAndData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.SignatureAndData".into() } } /// TimestampedSignatureData contains the signature data and the timestamp of the @@ -126,7 +142,10 @@ impl ::prost::Name for TimestampedSignatureData { const NAME: &'static str = "TimestampedSignatureData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.TimestampedSignatureData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.TimestampedSignatureData".into() } } /// SignBytes defines the signed bytes used for signature verification. @@ -150,7 +169,10 @@ impl ::prost::Name for SignBytes { const NAME: &'static str = "SignBytes"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.SignBytes".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.SignBytes".into() } } /// HeaderData returns the SignBytes data for update verification. @@ -159,7 +181,7 @@ impl ::prost::Name for SignBytes { pub struct HeaderData { /// header public key #[prost(message, optional, tag = "1")] - pub new_pub_key: ::core::option::Option<::prost_types::Any>, + pub new_pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// header diversifier #[prost(string, tag = "2")] pub new_diversifier: ::prost::alloc::string::String, @@ -168,7 +190,10 @@ impl ::prost::Name for HeaderData { const NAME: &'static str = "HeaderData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.HeaderData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.HeaderData".into() } } /// ClientStateData returns the SignBytes data for client state verification. @@ -178,13 +203,16 @@ 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>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for ClientStateData { const NAME: &'static str = "ClientStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.ClientStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.ClientStateData".into() } } /// ConsensusStateData returns the SignBytes data for consensus state @@ -195,13 +223,16 @@ 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>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for ConsensusStateData { const NAME: &'static str = "ConsensusStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.ConsensusStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.ConsensusStateData".into() } } /// ConnectionStateData returns the SignBytes data for connection state @@ -219,7 +250,10 @@ impl ::prost::Name for ConnectionStateData { const NAME: &'static str = "ConnectionStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.ConnectionStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.ConnectionStateData".into() } } /// ChannelStateData returns the SignBytes data for channel state @@ -236,7 +270,10 @@ impl ::prost::Name for ChannelStateData { const NAME: &'static str = "ChannelStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.ChannelStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.ChannelStateData".into() } } /// PacketCommitmentData returns the SignBytes data for packet commitment @@ -253,7 +290,10 @@ impl ::prost::Name for PacketCommitmentData { const NAME: &'static str = "PacketCommitmentData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.PacketCommitmentData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.PacketCommitmentData".into() } } /// PacketAcknowledgementData returns the SignBytes data for acknowledgement @@ -270,7 +310,10 @@ impl ::prost::Name for PacketAcknowledgementData { const NAME: &'static str = "PacketAcknowledgementData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.PacketAcknowledgementData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.PacketAcknowledgementData".into() } } /// PacketReceiptAbsenceData returns the SignBytes data for @@ -285,7 +328,10 @@ impl ::prost::Name for PacketReceiptAbsenceData { const NAME: &'static str = "PacketReceiptAbsenceData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData".into() } } /// NextSequenceRecvData returns the SignBytes data for verification of the next @@ -302,7 +348,10 @@ impl ::prost::Name for NextSequenceRecvData { const NAME: &'static str = "NextSequenceRecvData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v1.{}", Self::NAME) + "ibc.lightclients.solomachine.v1.NextSequenceRecvData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v1.NextSequenceRecvData".into() } } /// DataType defines the type of solo machine proof being created. This is done 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 index 958de772..1b4120c6 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// 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)] @@ -20,7 +21,10 @@ impl ::prost::Name for ClientState { const NAME: &'static str = "ClientState"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.ClientState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.ClientState".into() } } /// ConsensusState defines a solo machine consensus state. The sequence of a @@ -31,7 +35,7 @@ impl ::prost::Name for ClientState { pub struct ConsensusState { /// public key of the solo machine #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::prost_types::Any>, + pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// diversifier allows the same public key to be re-used across different solo /// machine clients (potentially on different chains) without being considered /// misbehaviour. @@ -44,7 +48,10 @@ impl ::prost::Name for ConsensusState { const NAME: &'static str = "ConsensusState"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.ConsensusState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.ConsensusState".into() } } /// Header defines a solo machine consensus header @@ -59,7 +66,7 @@ pub struct Header { #[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>, + pub new_public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, #[prost(string, tag = "5")] pub new_diversifier: ::prost::alloc::string::String, } @@ -67,7 +74,10 @@ impl ::prost::Name for Header { const NAME: &'static str = "Header"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.Header".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.Header".into() } } /// Misbehaviour defines misbehaviour for a solo machine which consists @@ -88,7 +98,10 @@ impl ::prost::Name for Misbehaviour { const NAME: &'static str = "Misbehaviour"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.Misbehaviour".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.Misbehaviour".into() } } /// SignatureAndData contains a signature and the data signed over to create that @@ -109,7 +122,10 @@ impl ::prost::Name for SignatureAndData { const NAME: &'static str = "SignatureAndData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.SignatureAndData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.SignatureAndData".into() } } /// TimestampedSignatureData contains the signature data and the timestamp of the @@ -126,7 +142,10 @@ impl ::prost::Name for TimestampedSignatureData { const NAME: &'static str = "TimestampedSignatureData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.TimestampedSignatureData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.TimestampedSignatureData".into() } } /// SignBytes defines the signed bytes used for signature verification. @@ -150,7 +169,10 @@ impl ::prost::Name for SignBytes { const NAME: &'static str = "SignBytes"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.SignBytes".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.SignBytes".into() } } /// HeaderData returns the SignBytes data for update verification. @@ -159,7 +181,7 @@ impl ::prost::Name for SignBytes { pub struct HeaderData { /// header public key #[prost(message, optional, tag = "1")] - pub new_pub_key: ::core::option::Option<::prost_types::Any>, + pub new_pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// header diversifier #[prost(string, tag = "2")] pub new_diversifier: ::prost::alloc::string::String, @@ -168,7 +190,10 @@ impl ::prost::Name for HeaderData { const NAME: &'static str = "HeaderData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.HeaderData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.HeaderData".into() } } /// ClientStateData returns the SignBytes data for client state verification. @@ -178,13 +203,16 @@ 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>, + pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for ClientStateData { const NAME: &'static str = "ClientStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.ClientStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.ClientStateData".into() } } /// ConsensusStateData returns the SignBytes data for consensus state @@ -195,13 +223,16 @@ 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>, + pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } impl ::prost::Name for ConsensusStateData { const NAME: &'static str = "ConsensusStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.ConsensusStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.ConsensusStateData".into() } } /// ConnectionStateData returns the SignBytes data for connection state @@ -219,7 +250,10 @@ impl ::prost::Name for ConnectionStateData { const NAME: &'static str = "ConnectionStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.ConnectionStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.ConnectionStateData".into() } } /// ChannelStateData returns the SignBytes data for channel state @@ -236,7 +270,10 @@ impl ::prost::Name for ChannelStateData { const NAME: &'static str = "ChannelStateData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.ChannelStateData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.ChannelStateData".into() } } /// PacketCommitmentData returns the SignBytes data for packet commitment @@ -253,7 +290,10 @@ impl ::prost::Name for PacketCommitmentData { const NAME: &'static str = "PacketCommitmentData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.PacketCommitmentData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.PacketCommitmentData".into() } } /// PacketAcknowledgementData returns the SignBytes data for acknowledgement @@ -270,7 +310,10 @@ impl ::prost::Name for PacketAcknowledgementData { const NAME: &'static str = "PacketAcknowledgementData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.PacketAcknowledgementData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.PacketAcknowledgementData".into() } } /// PacketReceiptAbsenceData returns the SignBytes data for @@ -285,7 +328,10 @@ impl ::prost::Name for PacketReceiptAbsenceData { const NAME: &'static str = "PacketReceiptAbsenceData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.PacketReceiptAbsenceData".into() } } /// NextSequenceRecvData returns the SignBytes data for verification of the next @@ -302,7 +348,10 @@ impl ::prost::Name for NextSequenceRecvData { const NAME: &'static str = "NextSequenceRecvData"; const PACKAGE: &'static str = "ibc.lightclients.solomachine.v2"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.solomachine.v2.{}", Self::NAME) + "ibc.lightclients.solomachine.v2.NextSequenceRecvData".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.solomachine.v2.NextSequenceRecvData".into() } } /// DataType defines the type of solo machine proof being created. This is done 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 index 4819686b..4f539584 100644 --- 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 @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// ClientState from Tendermint tracks the current validator set, latest height, /// and a possible frozen height. #[allow(clippy::derive_partial_eq_without_eq)] @@ -10,13 +11,13 @@ pub struct ClientState { /// 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>, + pub trusting_period: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, /// duration of the staking unbonding period #[prost(message, optional, tag = "4")] - pub unbonding_period: ::core::option::Option<::prost_types::Duration>, + pub unbonding_period: ::core::option::Option<::tendermint_proto::google::protobuf::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>, + pub max_clock_drift: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, /// Block height when the client was frozen due to a misbehaviour #[prost(message, optional, tag = "6")] pub frozen_height: ::core::option::Option, @@ -48,7 +49,10 @@ impl ::prost::Name for ClientState { const NAME: &'static str = "ClientState"; const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + "ibc.lightclients.tendermint.v1.ClientState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.tendermint.v1.ClientState".into() } } /// ConsensusState defines the consensus state from Tendermint. @@ -58,7 +62,7 @@ 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>, + pub timestamp: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// commitment root (i.e app hash) #[prost(message, optional, tag = "2")] pub root: ::core::option::Option, @@ -69,7 +73,10 @@ impl ::prost::Name for ConsensusState { const NAME: &'static str = "ConsensusState"; const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + "ibc.lightclients.tendermint.v1.ConsensusState".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.tendermint.v1.ConsensusState".into() } } /// Misbehaviour is a wrapper over two conflicting Headers @@ -88,7 +95,10 @@ impl ::prost::Name for Misbehaviour { const NAME: &'static str = "Misbehaviour"; const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + "ibc.lightclients.tendermint.v1.Misbehaviour".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.tendermint.v1.Misbehaviour".into() } } /// Header defines the Tendermint client consensus Header. @@ -119,13 +129,16 @@ impl ::prost::Name for Header { const NAME: &'static str = "Header"; const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + "ibc.lightclients.tendermint.v1.Header".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.tendermint.v1.Header".into() } } /// 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)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Fraction { #[prost(uint64, tag = "1")] pub numerator: u64, @@ -136,6 +149,9 @@ impl ::prost::Name for Fraction { const NAME: &'static str = "Fraction"; const PACKAGE: &'static str = "ibc.lightclients.tendermint.v1"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.lightclients.tendermint.v1.{}", Self::NAME) + "ibc.lightclients.tendermint.v1.Fraction".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.lightclients.tendermint.v1.Fraction".into() } } diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs b/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs index a011ad65..f2404b16 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// * /// 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 @@ -34,7 +35,10 @@ impl ::prost::Name for ExistenceProof { const NAME: &'static str = "ExistenceProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.ExistenceProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.ExistenceProof".into() } } /// @@ -56,7 +60,10 @@ impl ::prost::Name for NonExistenceProof { const NAME: &'static str = "NonExistenceProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.NonExistenceProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.NonExistenceProof".into() } } /// @@ -86,7 +93,10 @@ impl ::prost::Name for CommitmentProof { const NAME: &'static str = "CommitmentProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.CommitmentProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.CommitmentProof".into() } } /// * @@ -124,7 +134,10 @@ impl ::prost::Name for LeafOp { const NAME: &'static str = "LeafOp"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.LeafOp".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.LeafOp".into() } } /// * @@ -157,7 +170,10 @@ impl ::prost::Name for InnerOp { const NAME: &'static str = "InnerOp"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.InnerOp".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.InnerOp".into() } } /// * @@ -191,7 +207,10 @@ impl ::prost::Name for ProofSpec { const NAME: &'static str = "ProofSpec"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.ProofSpec".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.ProofSpec".into() } } /// @@ -228,7 +247,10 @@ impl ::prost::Name for InnerSpec { const NAME: &'static str = "InnerSpec"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.InnerSpec".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.InnerSpec".into() } } /// @@ -243,7 +265,10 @@ impl ::prost::Name for BatchProof { const NAME: &'static str = "BatchProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.BatchProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.BatchProof".into() } } /// Use BatchEntry not CommitmentProof, to avoid recursion @@ -268,7 +293,10 @@ impl ::prost::Name for BatchEntry { const NAME: &'static str = "BatchEntry"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.BatchEntry".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.BatchEntry".into() } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -283,7 +311,10 @@ impl ::prost::Name for CompressedBatchProof { const NAME: &'static str = "CompressedBatchProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.CompressedBatchProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.CompressedBatchProof".into() } } /// Use BatchEntry not CommitmentProof, to avoid recursion @@ -308,7 +339,10 @@ impl ::prost::Name for CompressedBatchEntry { const NAME: &'static str = "CompressedBatchEntry"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.CompressedBatchEntry".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.CompressedBatchEntry".into() } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -328,7 +362,10 @@ impl ::prost::Name for CompressedExistenceProof { const NAME: &'static str = "CompressedExistenceProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.CompressedExistenceProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.CompressedExistenceProof".into() } } #[allow(clippy::derive_partial_eq_without_eq)] @@ -346,7 +383,10 @@ impl ::prost::Name for CompressedNonExistenceProof { const NAME: &'static str = "CompressedNonExistenceProof"; const PACKAGE: &'static str = "ics23"; fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ics23.{}", Self::NAME) + "ics23.CompressedNonExistenceProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ics23.CompressedNonExistenceProof".into() } } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/TOKENFACTORY_COMMIT b/cosmos-sdk-proto/src/prost/tokenfactory/TOKENFACTORY_COMMIT new file mode 100644 index 00000000..1cc47adf --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/TOKENFACTORY_COMMIT @@ -0,0 +1 @@ +v0.50.3-wasmvm2 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/amino.rs b/cosmos-sdk-proto/src/prost/tokenfactory/amino.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/amino.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.bank.v1beta1.rs new file mode 100644 index 00000000..c5253b32 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.bank.v1beta1.rs @@ -0,0 +1,114 @@ +// @generated +/// Params defines the parameters for the bank module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Deprecated: Use of SendEnabled in params is deprecated. + /// For genesis, use the newly added send_enabled field in the genesis object. + /// Storage, lookup, and manipulation of this information is now in the keeper. + /// + /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + #[deprecated] + #[prost(message, repeated, tag = "1")] + pub send_enabled: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "2")] + pub default_send_enabled: bool, +} +/// SendEnabled maps coin denom to a send_enabled status (whether a denom is +/// sendable). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SendEnabled { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub enabled: bool, +} +/// Input models transaction input. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Input { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// Output models transaction outputs. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Output { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// Supply represents a struct that passively keeps track of the total supply +/// amounts in the network. +/// This message is deprecated now that supply is indexed by denom. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Supply { + #[prost(message, repeated, tag = "1")] + pub total: ::prost::alloc::vec::Vec, +} +/// DenomUnit represents a struct that describes a given +/// denomination unit of the basic token. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DenomUnit { + /// denom represents the string name of the given denom unit (e.g uatom). + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// exponent represents power of 10 exponent that one must + /// raise the base_denom to in order to equal the given DenomUnit's denom + /// 1 denom = 10^exponent base_denom + /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + /// exponent = 6, thus: 1 atom = 10^6 uatom). + #[prost(uint32, tag = "2")] + pub exponent: u32, + /// aliases is a list of string aliases for the given denom + #[prost(string, repeated, tag = "3")] + pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Metadata represents a struct that describes +/// a basic token. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Metadata { + #[prost(string, tag = "1")] + pub description: ::prost::alloc::string::String, + /// denom_units represents the list of DenomUnit's for a given coin + #[prost(message, repeated, tag = "2")] + pub denom_units: ::prost::alloc::vec::Vec, + /// base represents the base denom (should be the DenomUnit with exponent = 0). + #[prost(string, tag = "3")] + pub base: ::prost::alloc::string::String, + /// display indicates the suggested denom that should be + /// displayed in clients. + #[prost(string, tag = "4")] + pub display: ::prost::alloc::string::String, + /// name defines the name of the token (eg: Cosmos Atom) + /// + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "5")] + pub name: ::prost::alloc::string::String, + /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + /// be the same as the display. + /// + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "6")] + pub symbol: ::prost::alloc::string::String, + /// URI to a document (on or off-chain) that contains additional information. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "7")] + pub uri: ::prost::alloc::string::String, + /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + /// the document didn't change. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "8")] + pub uri_hash: ::prost::alloc::string::String, +} +include!("cosmos.bank.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.bank.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.bank.v1beta1.serde.rs new file mode 100644 index 00000000..d870e2d9 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.bank.v1beta1.serde.rs @@ -0,0 +1,897 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for DenomUnit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.exponent != 0 { + len += 1; + } + if !self.aliases.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.DenomUnit", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if self.exponent != 0 { + struct_ser.serialize_field("exponent", &self.exponent)?; + } + if !self.aliases.is_empty() { + struct_ser.serialize_field("aliases", &self.aliases)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DenomUnit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "exponent", "aliases"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Exponent, + Aliases, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.DenomUnit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Input { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Input", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Input { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Input") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Metadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.description.is_empty() { + len += 1; + } + if !self.denom_units.is_empty() { + len += 1; + } + if !self.base.is_empty() { + len += 1; + } + if !self.display.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.symbol.is_empty() { + len += 1; + } + if !self.uri.is_empty() { + len += 1; + } + if !self.uri_hash.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Metadata", len)?; + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.denom_units.is_empty() { + struct_ser.serialize_field("denomUnits", &self.denom_units)?; + } + if !self.base.is_empty() { + struct_ser.serialize_field("base", &self.base)?; + } + if !self.display.is_empty() { + struct_ser.serialize_field("display", &self.display)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.symbol.is_empty() { + struct_ser.serialize_field("symbol", &self.symbol)?; + } + if !self.uri.is_empty() { + struct_ser.serialize_field("uri", &self.uri)?; + } + if !self.uri_hash.is_empty() { + struct_ser.serialize_field("uriHash", &self.uri_hash)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Metadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Metadata") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Output { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Output", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Output { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Output") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.send_enabled.is_empty() { + len += 1; + } + if self.default_send_enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Params", len)?; + if !self.send_enabled.is_empty() { + struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; + } + if self.default_send_enabled { + struct_ser.serialize_field("defaultSendEnabled", &self.default_send_enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SendEnabled { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.SendEnabled", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if self.enabled { + struct_ser.serialize_field("enabled", &self.enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SendEnabled { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "enabled"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Enabled, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.SendEnabled") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Supply { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.total.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Supply", len)?; + if !self.total.is_empty() { + struct_ser.serialize_field("total", &self.total)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Supply { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Supply") + } + + fn visit_map(self, mut map_: V) -> std::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/tokenfactory/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.query.v1beta1.rs new file mode 100644 index 00000000..9e79d078 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.query.v1beta1.rs @@ -0,0 +1,59 @@ +// @generated +/// PageRequest is to be embedded in gRPC request messages for efficient +/// pagination. Ex: +/// +/// message SomeRequest { +/// Foo some_parameter = 1; +/// PageRequest pagination = 2; +/// } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageRequest { + /// key is a value returned in PageResponse.next_key to begin + /// querying the next page most efficiently. Only one of offset or key + /// should be set. + #[prost(bytes = "vec", tag = "1")] + pub key: ::prost::alloc::vec::Vec, + /// offset is a numeric offset that can be used when key is unavailable. + /// It is less efficient than using key. Only one of offset or key should + /// be set. + #[prost(uint64, tag = "2")] + pub offset: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. + #[prost(uint64, tag = "3")] + pub limit: u64, + /// count_total is set to true to indicate that the result set should include + /// a count of the total number of items available for pagination in UIs. + /// count_total is only respected when offset is used. It is ignored when key + /// is set. + #[prost(bool, tag = "4")] + pub count_total: bool, + /// reverse is set to true if results are to be returned in the descending order. + /// + /// Since: cosmos-sdk 0.43 + #[prost(bool, tag = "5")] + pub reverse: bool, +} +/// PageResponse is to be embedded in gRPC response messages where the +/// corresponding request message has used PageRequest. +/// +/// message SomeResponse { +/// repeated Bar results = 1; +/// PageResponse page = 2; +/// } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageResponse { + /// next_key is the key to be passed to PageRequest.key to + /// query the next page most efficiently. It will be empty if + /// there are no more results. + #[prost(bytes = "vec", tag = "1")] + pub next_key: ::prost::alloc::vec::Vec, + /// total is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise + #[prost(uint64, tag = "2")] + pub total: u64, +} +include!("cosmos.base.query.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.query.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.query.v1beta1.serde.rs new file mode 100644 index 00000000..27639f3d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,312 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PageRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if self.offset != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + if self.count_total { + len += 1; + } + if self.reverse { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageRequest", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if self.offset != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + if self.count_total { + struct_ser.serialize_field("countTotal", &self.count_total)?; + } + if self.reverse { + struct_ser.serialize_field("reverse", &self.reverse)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PageResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.next_key.is_empty() { + len += 1; + } + if self.total != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageResponse", len)?; + if !self.next_key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextKey", + pbjson::private::base64::encode(&self.next_key).as_str(), + )?; + } + if self.total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["next_key", "nextKey", "total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextKey, + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageResponse") + } + + fn visit_map(self, mut map_: V) -> std::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/tokenfactory/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.v1beta1.rs new file mode 100644 index 00000000..b36ec8b7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.v1beta1.rs @@ -0,0 +1,27 @@ +// @generated +/// 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, +} +include!("cosmos.base.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..40f3eea1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.base.v1beta1.serde.rs @@ -0,0 +1,223 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Coin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.Coin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Coin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.Coin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecCoin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecCoin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecCoin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecCoin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.msg.v1.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.msg.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos.msg.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos_proto.rs new file mode 100644 index 00000000..2353a154 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos_proto.rs @@ -0,0 +1,76 @@ +// @generated +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterfaceDescriptor { + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScalarDescriptor { + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + #[prost(enumeration = "ScalarType", repeated, tag = "3")] + pub field_type: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ScalarType { + Unspecified = 0, + String = 1, + Bytes = 2, +} +impl ScalarType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + ScalarType::String => "SCALAR_TYPE_STRING", + ScalarType::Bytes => "SCALAR_TYPE_BYTES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SCALAR_TYPE_STRING" => Some(Self::String), + "SCALAR_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } +} +include!("cosmos_proto.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/cosmos_proto.serde.rs b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos_proto.serde.rs new file mode 100644 index 00000000..0ebdf0ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/cosmos_proto.serde.rs @@ -0,0 +1,334 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos_proto.InterfaceDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "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 = InterfaceDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(InterfaceDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos_proto.InterfaceDescriptor", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.field_type.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos_proto.ScalarDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.field_type.is_empty() { + let v = self + .field_type + .iter() + .cloned() + .map(|v| { + ScalarType::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }) + .collect::, _>>()?; + struct_ser.serialize_field("fieldType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description", "field_type", "fieldType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + FieldType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + "fieldType" | "field_type" => Ok(GeneratedField::FieldType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.ScalarDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + let mut field_type__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::FieldType => { + if field_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldType")); + } + field_type__ = Some( + map_.next_value::>()? + .into_iter() + .map(|x| x as i32) + .collect(), + ); + } + } + } + Ok(ScalarDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + field_type: field_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos_proto.ScalarDescriptor", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCALAR_TYPE_UNSPECIFIED", + "SCALAR_TYPE_STRING", + "SCALAR_TYPE_BYTES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Ok(ScalarType::Unspecified), + "SCALAR_TYPE_STRING" => Ok(ScalarType::String), + "SCALAR_TYPE_BYTES" => Ok(ScalarType::Bytes), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.rs b/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.rs new file mode 100644 index 00000000..b258b1ee --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.rs @@ -0,0 +1,217 @@ +// @generated +/// DenomAuthorityMetadata specifies metadata for addresses that have specific +/// capabilities over a token factory denom. Right now there is only one Admin +/// permission, but is planned to be extended to the future. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DenomAuthorityMetadata { + /// Can be empty for no admin, or a valid osmosis address + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, +} +/// Params defines the parameters for the tokenfactory module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + #[prost(message, repeated, tag = "1")] + pub denom_creation_fee: + ::prost::alloc::vec::Vec, + /// if denom_creation_fee is an empty array, then this field is used to add more gas consumption + /// to the base cost. + /// + #[prost(uint64, tag = "2")] + pub denom_creation_gas_consume: u64, +} +/// GenesisState defines the tokenfactory module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub factory_denoms: ::prost::alloc::vec::Vec, +} +/// GenesisDenom defines a tokenfactory denom that is defined within genesis +/// state. The structure contains DenomAuthorityMetadata which defines the +/// denom's admin. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisDenom { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub authority_metadata: ::core::option::Option, +} +/// 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, +} +/// QueryDenomAuthorityMetadataRequest defines the request structure for the +/// DenomAuthorityMetadata gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomAuthorityMetadataRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryDenomAuthorityMetadataResponse defines the response structure for the +/// DenomAuthorityMetadata gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomAuthorityMetadataResponse { + #[prost(message, optional, tag = "1")] + pub authority_metadata: ::core::option::Option, +} +/// QueryDenomsFromCreatorRequest defines the request structure for the +/// DenomsFromCreator gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomsFromCreatorRequest { + #[prost(string, tag = "1")] + pub creator: ::prost::alloc::string::String, +} +/// QueryDenomsFromCreatorRequest defines the response structure for the +/// DenomsFromCreator gRPC query. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomsFromCreatorResponse { + #[prost(string, repeated, tag = "1")] + pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgCreateDenom defines the message structure for the CreateDenom gRPC service +/// method. It allows an account to create a new denom. It requires a sender +/// address and a sub denomination. The (sender_address, sub_denomination) tuple +/// must be unique and cannot be re-used. +/// +/// The resulting denom created is defined as +/// . The resulting denom's admin is +/// originally set to be the creator, but this can be changed later. The token +/// denom does not indicate the current admin. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateDenom { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + /// subdenom can be up to 44 "alphanumeric" characters long. + #[prost(string, tag = "2")] + pub subdenom: ::prost::alloc::string::String, +} +/// MsgCreateDenomResponse is the return value of MsgCreateDenom +/// It returns the full string of the newly created denom +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateDenomResponse { + #[prost(string, tag = "1")] + pub new_token_denom: ::prost::alloc::string::String, +} +/// MsgMint is the sdk.Msg type for allowing an admin account to mint +/// more of a token. For now, we only support minting to the sender account +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMint { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub mint_to_address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMintResponse {} +/// MsgBurn is the sdk.Msg type for allowing an admin account to burn +/// a token. For now, we only support burning from the sender account. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBurn { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub burn_from_address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBurnResponse {} +/// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign +/// adminship of a denom to a new account +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChangeAdmin { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, +} +/// MsgChangeAdminResponse defines the response structure for an executed +/// MsgChangeAdmin message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChangeAdminResponse {} +/// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set +/// the denom's bank metadata +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetDenomMetadata { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub metadata: ::core::option::Option, +} +/// MsgSetDenomMetadataResponse defines the response structure for an executed +/// MsgSetDenomMetadata message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetDenomMetadataResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgForceTransfer { + #[prost(string, tag = "1")] + pub sender: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, + #[prost(string, tag = "3")] + pub transfer_from_address: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub transfer_to_address: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgForceTransferResponse {} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/mint parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("osmosis.tokenfactory.v1beta1.serde.rs"); +include!("osmosis.tokenfactory.v1beta1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.serde.rs new file mode 100644 index 00000000..97b1d15c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.serde.rs @@ -0,0 +1,2570 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for DenomAuthorityMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DenomAuthorityMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DenomAuthorityMetadata; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut 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()?); + } + } + } + Ok(DenomAuthorityMetadata { + admin: admin__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.DenomAuthorityMetadata", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisDenom { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.authority_metadata.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.GenesisDenom", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if let Some(v) = self.authority_metadata.as_ref() { + struct_ser.serialize_field("authorityMetadata", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisDenom { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "authority_metadata", "authorityMetadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + AuthorityMetadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "denom" => Ok(GeneratedField::Denom), + "authorityMetadata" | "authority_metadata" => { + Ok(GeneratedField::AuthorityMetadata) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisDenom; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.GenesisDenom") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom__ = None; + let mut authority_metadata__ = 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::AuthorityMetadata => { + if authority_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("authorityMetadata")); + } + authority_metadata__ = map_.next_value()?; + } + } + } + Ok(GenesisDenom { + denom: denom__.unwrap_or_default(), + authority_metadata: authority_metadata__, + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.GenesisDenom", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.factory_denoms.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if !self.factory_denoms.is_empty() { + struct_ser.serialize_field("factoryDenoms", &self.factory_denoms)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params", "factory_denoms", "factoryDenoms"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + FactoryDenoms, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + "factoryDenoms" | "factory_denoms" => Ok(GeneratedField::FactoryDenoms), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut factory_denoms__ = 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::FactoryDenoms => { + if factory_denoms__.is_some() { + return Err(serde::de::Error::duplicate_field("factoryDenoms")); + } + factory_denoms__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + factory_denoms: factory_denoms__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.GenesisState", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgBurn { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + if !self.burn_from_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgBurn", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + if !self.burn_from_address.is_empty() { + struct_ser.serialize_field("burnFromAddress", &self.burn_from_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgBurn { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "amount", "burnFromAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Amount, + BurnFromAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "amount" => Ok(GeneratedField::Amount), + "burnFromAddress" => Ok(GeneratedField::BurnFromAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgBurn; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgBurn") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut amount__ = None; + let mut burn_from_address__ = 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::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + GeneratedField::BurnFromAddress => { + if burn_from_address__.is_some() { + return Err(serde::de::Error::duplicate_field("burnFromAddress")); + } + burn_from_address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgBurn { + sender: sender__.unwrap_or_default(), + amount: amount__, + burn_from_address: burn_from_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgBurn", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgBurnResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgBurnResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgBurnResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgBurnResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgBurnResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgBurnResponse {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgBurnResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgChangeAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.denom.is_empty() { + len += 1; + } + if !self.new_admin.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgChangeAdmin", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.new_admin.is_empty() { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgChangeAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "denom", "new_admin", "newAdmin"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Denom, + NewAdmin, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "denom" => Ok(GeneratedField::Denom), + "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 = MsgChangeAdmin; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgChangeAdmin") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut denom__ = None; + let mut new_admin__ = 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::Denom => { + if denom__.is_some() { + return Err(serde::de::Error::duplicate_field("denom")); + } + denom__ = 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(MsgChangeAdmin { + sender: sender__.unwrap_or_default(), + denom: denom__.unwrap_or_default(), + new_admin: new_admin__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgChangeAdmin", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgChangeAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgChangeAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChangeAdminResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgChangeAdminResponse {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgChangeAdminResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateDenom { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.subdenom.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgCreateDenom", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.subdenom.is_empty() { + struct_ser.serialize_field("subdenom", &self.subdenom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateDenom { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "subdenom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Subdenom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "subdenom" => Ok(GeneratedField::Subdenom), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateDenom; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgCreateDenom") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut subdenom__ = 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::Subdenom => { + if subdenom__.is_some() { + return Err(serde::de::Error::duplicate_field("subdenom")); + } + subdenom__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateDenom { + sender: sender__.unwrap_or_default(), + subdenom: subdenom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgCreateDenom", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateDenomResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.new_token_denom.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse", len)?; + if !self.new_token_denom.is_empty() { + struct_ser.serialize_field("newTokenDenom", &self.new_token_denom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateDenomResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["new_token_denom", "newTokenDenom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NewTokenDenom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "newTokenDenom" | "new_token_denom" => { + Ok(GeneratedField::NewTokenDenom) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateDenomResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut new_token_denom__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NewTokenDenom => { + if new_token_denom__.is_some() { + return Err(serde::de::Error::duplicate_field("newTokenDenom")); + } + new_token_denom__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateDenomResponse { + new_token_denom: new_token_denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgCreateDenomResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgForceTransfer { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + if !self.transfer_from_address.is_empty() { + len += 1; + } + if !self.transfer_to_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgForceTransfer", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + if !self.transfer_from_address.is_empty() { + struct_ser.serialize_field("transferFromAddress", &self.transfer_from_address)?; + } + if !self.transfer_to_address.is_empty() { + struct_ser.serialize_field("transferToAddress", &self.transfer_to_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgForceTransfer { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sender", + "amount", + "transferFromAddress", + "transferToAddress", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Amount, + TransferFromAddress, + TransferToAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "amount" => Ok(GeneratedField::Amount), + "transferFromAddress" => Ok(GeneratedField::TransferFromAddress), + "transferToAddress" => Ok(GeneratedField::TransferToAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgForceTransfer; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgForceTransfer") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut amount__ = None; + let mut transfer_from_address__ = None; + let mut transfer_to_address__ = 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::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + GeneratedField::TransferFromAddress => { + if transfer_from_address__.is_some() { + return Err(serde::de::Error::duplicate_field( + "transferFromAddress", + )); + } + transfer_from_address__ = Some(map_.next_value()?); + } + GeneratedField::TransferToAddress => { + if transfer_to_address__.is_some() { + return Err(serde::de::Error::duplicate_field("transferToAddress")); + } + transfer_to_address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgForceTransfer { + sender: sender__.unwrap_or_default(), + amount: amount__, + transfer_from_address: transfer_from_address__.unwrap_or_default(), + transfer_to_address: transfer_to_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgForceTransfer", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgForceTransferResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("osmosis.tokenfactory.v1beta1.MsgForceTransferResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgForceTransferResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgForceTransferResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgForceTransferResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgForceTransferResponse {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgForceTransferResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMint { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if self.amount.is_some() { + len += 1; + } + if !self.mint_to_address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgMint", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + if !self.mint_to_address.is_empty() { + struct_ser.serialize_field("mintToAddress", &self.mint_to_address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMint { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "amount", "mintToAddress"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Amount, + MintToAddress, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "amount" => Ok(GeneratedField::Amount), + "mintToAddress" => Ok(GeneratedField::MintToAddress), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMint; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgMint") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut amount__ = None; + let mut mint_to_address__ = 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::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + GeneratedField::MintToAddress => { + if mint_to_address__.is_some() { + return Err(serde::de::Error::duplicate_field("mintToAddress")); + } + mint_to_address__ = Some(map_.next_value()?); + } + } + } + Ok(MsgMint { + sender: sender__.unwrap_or_default(), + amount: amount__, + mint_to_address: mint_to_address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgMint", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMintResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgMintResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMintResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMintResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgMintResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgMintResponse {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgMintResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSetDenomMetadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if self.metadata.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if let Some(v) = self.metadata.as_ref() { + struct_ser.serialize_field("metadata", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSetDenomMetadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "metadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "sender" => Ok(GeneratedField::Sender), + "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 = MsgSetDenomMetadata; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sender__ = None; + let mut metadata__ = 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::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = map_.next_value()?; + } + } + } + Ok(MsgSetDenomMetadata { + sender: sender__.unwrap_or_default(), + metadata: metadata__, + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSetDenomMetadataResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct( + "osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + len, + )?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSetDenomMetadataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSetDenomMetadataResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgSetDenomMetadataResponse {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgSetDenomMetadataResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.MsgUpdateParams", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> std::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( + "osmosis.tokenfactory.v1beta1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("osmosis.tokenfactory.v1beta1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.MsgUpdateParamsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom_creation_fee.is_empty() { + len += 1; + } + if self.denom_creation_gas_consume != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.Params", len)?; + if !self.denom_creation_fee.is_empty() { + struct_ser.serialize_field("denomCreationFee", &self.denom_creation_fee)?; + } + if self.denom_creation_gas_consume != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "denomCreationGasConsume", + ToString::to_string(&self.denom_creation_gas_consume).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom_creation_fee", + "denomCreationFee", + "denom_creation_gas_consume", + "denomCreationGasConsume", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DenomCreationFee, + DenomCreationGasConsume, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "denomCreationFee" | "denom_creation_fee" => { + Ok(GeneratedField::DenomCreationFee) + } + "denomCreationGasConsume" | "denom_creation_gas_consume" => { + Ok(GeneratedField::DenomCreationGasConsume) + } + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom_creation_fee__ = None; + let mut denom_creation_gas_consume__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DenomCreationFee => { + if denom_creation_fee__.is_some() { + return Err(serde::de::Error::duplicate_field("denomCreationFee")); + } + denom_creation_fee__ = Some(map_.next_value()?); + } + GeneratedField::DenomCreationGasConsume => { + if denom_creation_gas_consume__.is_some() { + return Err(serde::de::Error::duplicate_field( + "denomCreationGasConsume", + )); + } + denom_creation_gas_consume__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Params { + denom_creation_fee: denom_creation_fee__.unwrap_or_default(), + denom_creation_gas_consume: denom_creation_gas_consume__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.Params", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomAuthorityMetadataRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + len, + )?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomAuthorityMetadataRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryDenomAuthorityMetadataRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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(QueryDenomAuthorityMetadataRequest { + denom: denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomAuthorityMetadataResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.authority_metadata.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + len, + )?; + if let Some(v) = self.authority_metadata.as_ref() { + struct_ser.serialize_field("authorityMetadata", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomAuthorityMetadataResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority_metadata", "authorityMetadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AuthorityMetadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "authorityMetadata" | "authority_metadata" => { + Ok(GeneratedField::AuthorityMetadata) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomAuthorityMetadataResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority_metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AuthorityMetadata => { + if authority_metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("authorityMetadata")); + } + authority_metadata__ = map_.next_value()?; + } + } + } + Ok(QueryDenomAuthorityMetadataResponse { + authority_metadata: authority_metadata__, + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomsFromCreatorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.creator.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + len, + )?; + if !self.creator.is_empty() { + struct_ser.serialize_field("creator", &self.creator)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomsFromCreatorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["creator"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Creator, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "creator" => Ok(GeneratedField::Creator), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomsFromCreatorRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut creator__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Creator => { + if creator__.is_some() { + return Err(serde::de::Error::duplicate_field("creator")); + } + creator__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDenomsFromCreatorRequest { + creator: creator__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomsFromCreatorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denoms.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + len, + )?; + if !self.denoms.is_empty() { + struct_ser.serialize_field("denoms", &self.denoms)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomsFromCreatorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denoms"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denoms, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "denoms" => Ok(GeneratedField::Denoms), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomsFromCreatorResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denoms__ = 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()?); + } + } + } + Ok(QueryDenomsFromCreatorResponse { + denoms: denoms__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest {}) + } + } + deserializer.deserialize_struct( + "osmosis.tokenfactory.v1beta1.QueryParamsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("osmosis.tokenfactory.v1beta1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct osmosis.tokenfactory.v1beta1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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( + "osmosis.tokenfactory.v1beta1.QueryParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.tonic.rs new file mode 100644 index 00000000..81b8de28 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/tokenfactory/osmosis.tokenfactory.v1beta1.tonic.rs @@ -0,0 +1,1065 @@ +// @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("/osmosis.tokenfactory.v1beta1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "Params", + )); + self.inner.unary(req, path, codec).await + } + pub async fn denom_authority_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "DenomAuthorityMetadata", + )); + self.inner.unary(req, path, codec).await + } + pub async fn denoms_from_creator( + &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( + "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Query", + "DenomsFromCreator", + )); + 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>; + async fn denom_authority_metadata( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn denoms_from_creator( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + 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() { + "/osmosis.tokenfactory.v1beta1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture, tonic::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) + } + "/osmosis.tokenfactory.v1beta1.Query/DenomAuthorityMetadata" => { + #[allow(non_camel_case_types)] + struct DenomAuthorityMetadataSvc(pub Arc); + impl + tonic::server::UnaryService + for DenomAuthorityMetadataSvc + { + type Response = super::QueryDenomAuthorityMetadataResponse; + 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).denom_authority_metadata(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = DenomAuthorityMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.v1beta1.Query/DenomsFromCreator" => { + #[allow(non_camel_case_types)] + struct DenomsFromCreatorSvc(pub Arc); + impl tonic::server::UnaryService + for DenomsFromCreatorSvc + { + type Response = super::QueryDenomsFromCreatorResponse; + 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).denoms_from_creator(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = DenomsFromCreatorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "osmosis.tokenfactory.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 create_denom( + &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( + "/osmosis.tokenfactory.v1beta1.Msg/CreateDenom", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "CreateDenom", + )); + self.inner.unary(req, path, codec).await + } + pub async fn mint( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Mint"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("osmosis.tokenfactory.v1beta1.Msg", "Mint")); + self.inner.unary(req, path, codec).await + } + pub async fn burn( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/osmosis.tokenfactory.v1beta1.Msg/Burn"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("osmosis.tokenfactory.v1beta1.Msg", "Burn")); + self.inner.unary(req, path, codec).await + } + pub async fn change_admin( + &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( + "/osmosis.tokenfactory.v1beta1.Msg/ChangeAdmin", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "ChangeAdmin", + )); + self.inner.unary(req, path, codec).await + } + pub async fn set_denom_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/osmosis.tokenfactory.v1beta1.Msg/SetDenomMetadata", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "SetDenomMetadata", + )); + self.inner.unary(req, path, codec).await + } + pub async fn force_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( + "/osmosis.tokenfactory.v1beta1.Msg/ForceTransfer", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.v1beta1.Msg", + "ForceTransfer", + )); + 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( + "/osmosis.tokenfactory.v1beta1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "osmosis.tokenfactory.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 create_denom( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn mint( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn burn( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn change_admin( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn set_denom_metadata( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn force_transfer( + &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 { + 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() { + "/osmosis.tokenfactory.v1beta1.Msg/CreateDenom" => { + #[allow(non_camel_case_types)] + struct CreateDenomSvc(pub Arc); + impl tonic::server::UnaryService for CreateDenomSvc { + type Response = super::MsgCreateDenomResponse; + 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).create_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 = CreateDenomSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.v1beta1.Msg/Mint" => { + #[allow(non_camel_case_types)] + struct MintSvc(pub Arc); + impl tonic::server::UnaryService for MintSvc { + type Response = super::MsgMintResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).mint(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MintSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.v1beta1.Msg/Burn" => { + #[allow(non_camel_case_types)] + struct BurnSvc(pub Arc); + impl tonic::server::UnaryService for BurnSvc { + type Response = super::MsgBurnResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).burn(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BurnSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.v1beta1.Msg/ChangeAdmin" => { + #[allow(non_camel_case_types)] + struct ChangeAdminSvc(pub Arc); + impl tonic::server::UnaryService for ChangeAdminSvc { + type Response = super::MsgChangeAdminResponse; + 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).change_admin(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = ChangeAdminSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.v1beta1.Msg/SetDenomMetadata" => { + #[allow(non_camel_case_types)] + struct SetDenomMetadataSvc(pub Arc); + impl tonic::server::UnaryService for SetDenomMetadataSvc { + type Response = super::MsgSetDenomMetadataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).set_denom_metadata(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SetDenomMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.v1beta1.Msg/ForceTransfer" => { + #[allow(non_camel_case_types)] + struct ForceTransferSvc(pub Arc); + impl tonic::server::UnaryService for ForceTransferSvc { + type Response = super::MsgForceTransferResponse; + 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).force_transfer(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = ForceTransferSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/osmosis.tokenfactory.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 = "osmosis.tokenfactory.v1beta1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs index f37d3872..9e79d078 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.rs @@ -6,6 +6,7 @@ /// 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 @@ -41,6 +42,7 @@ pub struct PageRequest { /// 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 @@ -53,4 +55,5 @@ pub struct PageResponse { #[prost(uint64, tag = "2")] pub total: u64, } +include!("cosmos.base.query.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.serde.rs new file mode 100644 index 00000000..27639f3d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,312 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PageRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if self.offset != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + if self.count_total { + len += 1; + } + if self.reverse { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageRequest", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if self.offset != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + if self.count_total { + struct_ser.serialize_field("countTotal", &self.count_total)?; + } + if self.reverse { + struct_ser.serialize_field("reverse", &self.reverse)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PageResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.next_key.is_empty() { + len += 1; + } + if self.total != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageResponse", len)?; + if !self.next_key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextKey", + pbjson::private::base64::encode(&self.next_key).as_str(), + )?; + } + if self.total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["next_key", "nextKey", "total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextKey, + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageResponse") + } + + fn visit_map(self, mut map_: V) -> std::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/wasmd/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs index cc4421b2..8a02bbd7 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.rs @@ -3,6 +3,7 @@ /// /// 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")] @@ -14,6 +15,7 @@ pub struct Coin { /// /// 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")] @@ -22,15 +24,18 @@ pub struct DecCoin { 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, } +include!("cosmos.base.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..92880130 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.base.v1beta1.serde.rs @@ -0,0 +1,413 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Coin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.Coin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Coin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.Coin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecCoin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecCoin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecCoin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecCoin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.dec.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecProto", len)?; + if !self.dec.is_empty() { + struct_ser.serialize_field("dec", &self.dec)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["dec"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Dec, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecProto") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for IntProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.int.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.IntProto", len)?; + if !self.int.is_empty() { + struct_ser.serialize_field("int", &self.int)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for IntProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["int"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Int, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.IntProto") + } + + fn visit_map(self, mut map_: V) -> std::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/wasmd/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.rs index a74f2b1e..2353a154 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.rs @@ -1,6 +1,7 @@ // @generated /// InterfaceDescriptor describes an interface type to be used with /// accepts_interface and implements_interface and declared by declare_interface. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InterfaceDescriptor { /// name is the name of the interface. It should be a short-name (without @@ -21,6 +22,7 @@ pub struct InterfaceDescriptor { /// Scalars should ideally define an encoding such that there is only one /// valid syntactical representation for a given semantic meaning, /// i.e. the encoding should be deterministic. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ScalarDescriptor { /// name is the name of the scalar. It should be a short-name (without @@ -60,5 +62,15 @@ impl ScalarType { ScalarType::Bytes => "SCALAR_TYPE_BYTES", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SCALAR_TYPE_STRING" => Some(Self::String), + "SCALAR_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } } +include!("cosmos_proto.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.serde.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.serde.rs new file mode 100644 index 00000000..0ebdf0ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos_proto.serde.rs @@ -0,0 +1,334 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos_proto.InterfaceDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "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 = InterfaceDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(InterfaceDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos_proto.InterfaceDescriptor", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.field_type.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos_proto.ScalarDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.field_type.is_empty() { + let v = self + .field_type + .iter() + .cloned() + .map(|v| { + ScalarType::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }) + .collect::, _>>()?; + struct_ser.serialize_field("fieldType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description", "field_type", "fieldType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + FieldType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + "fieldType" | "field_type" => Ok(GeneratedField::FieldType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.ScalarDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + let mut field_type__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::FieldType => { + if field_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldType")); + } + field_type__ = Some( + map_.next_value::>()? + .into_iter() + .map(|x| x as i32) + .collect(), + ); + } + } + } + Ok(ScalarDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + field_type: field_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos_proto.ScalarDescriptor", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCALAR_TYPE_UNSPECIFIED", + "SCALAR_TYPE_STRING", + "SCALAR_TYPE_BYTES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Ok(ScalarType::Unspecified), + "SCALAR_TYPE_STRING" => Ok(ScalarType::String), + "SCALAR_TYPE_BYTES" => Ok(ScalarType::Bytes), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} 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..b7655700 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs @@ -1,11 +1,13 @@ // @generated /// AccessTypeParam +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessTypeParam { #[prost(enumeration = "AccessType", tag = "1")] pub value: i32, } /// AccessConfig access control type. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessConfig { #[prost(enumeration = "AccessType", tag = "1")] @@ -18,6 +20,7 @@ pub struct AccessConfig { pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Params defines the set of wasm parameters. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { #[prost(message, optional, tag = "1")] @@ -26,6 +29,7 @@ pub struct Params { pub instantiate_default_permission: i32, } /// CodeInfo is data for the uploaded contract WASM code +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodeInfo { /// CodeHash is the unique identifier created by wasmvm @@ -39,6 +43,7 @@ pub struct CodeInfo { pub instantiate_config: ::core::option::Option, } /// ContractInfo stores a WASM contract instance +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractInfo { /// CodeID is the reference to the stored Wasm code @@ -63,9 +68,10 @@ 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<::tendermint_proto::google::protobuf::Any>, } /// ContractCodeHistoryEntry metadata to a contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractCodeHistoryEntry { #[prost(enumeration = "ContractCodeHistoryOperationType", tag = "1")] @@ -81,6 +87,7 @@ pub struct ContractCodeHistoryEntry { } /// AbsoluteTxPosition is a unique transaction position that allows for global /// ordering of transactions. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbsoluteTxPosition { /// BlockHeight is the block the contract was created at @@ -92,6 +99,7 @@ pub struct AbsoluteTxPosition { pub tx_index: u64, } /// Model is a struct that holds a KV pair +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Model { /// hex-encode key to read it better (this is often ascii) @@ -131,6 +139,17 @@ impl AccessType { AccessType::AnyOfAddresses => "ACCESS_TYPE_ANY_OF_ADDRESSES", } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ACCESS_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "ACCESS_TYPE_NOBODY" => Some(Self::Nobody), + "ACCESS_TYPE_ONLY_ADDRESS" => Some(Self::OnlyAddress), + "ACCESS_TYPE_EVERYBODY" => Some(Self::Everybody), + "ACCESS_TYPE_ANY_OF_ADDRESSES" => Some(Self::AnyOfAddresses), + _ => None, + } + } } /// ContractCodeHistoryOperationType actions that caused a code change #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -164,8 +183,19 @@ impl ContractCodeHistoryOperationType { } } } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT" => Some(Self::Init), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE" => Some(Self::Migrate), + "CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS" => Some(Self::Genesis), + _ => None, + } + } } /// MsgStoreCode submit Wasm code to the system +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreCode { /// Sender is the that actor that signed the messages @@ -180,6 +210,7 @@ pub struct MsgStoreCode { pub instantiate_permission: ::core::option::Option, } /// MsgStoreCodeResponse returns store result data. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgStoreCodeResponse { /// CodeID is the reference to the stored WASM code @@ -191,6 +222,7 @@ pub struct MsgStoreCodeResponse { } /// MsgInstantiateContract create a new smart contract instance for the given /// code id. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContract { /// Sender is the that actor that signed the messages @@ -214,6 +246,7 @@ pub struct MsgInstantiateContract { } /// MsgInstantiateContract2 create a new smart contract instance for the given /// code id with a predicable address. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContract2 { /// Sender is the that actor that signed the messages @@ -243,6 +276,7 @@ pub struct MsgInstantiateContract2 { pub fix_msg: bool, } /// MsgInstantiateContractResponse return instantiation result data +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContractResponse { /// Address is the bech32 address of the new contract instance. @@ -253,6 +287,7 @@ pub struct MsgInstantiateContractResponse { pub data: ::prost::alloc::vec::Vec, } /// MsgInstantiateContract2Response return instantiation result data +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgInstantiateContract2Response { /// Address is the bech32 address of the new contract instance. @@ -263,6 +298,7 @@ pub struct MsgInstantiateContract2Response { pub data: ::prost::alloc::vec::Vec, } /// MsgExecuteContract submits the given message data to a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecuteContract { /// Sender is the that actor that signed the messages @@ -279,6 +315,7 @@ pub struct MsgExecuteContract { pub funds: ::prost::alloc::vec::Vec, } /// MsgExecuteContractResponse returns execution result data. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgExecuteContractResponse { /// Data contains bytes to returned from the contract @@ -286,6 +323,7 @@ pub struct MsgExecuteContractResponse { pub data: ::prost::alloc::vec::Vec, } /// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMigrateContract { /// Sender is the that actor that signed the messages @@ -302,6 +340,7 @@ pub struct MsgMigrateContract { pub msg: ::prost::alloc::vec::Vec, } /// MsgMigrateContractResponse returns contract migration result data. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgMigrateContractResponse { /// Data contains same raw bytes returned as data from the wasm contract. @@ -310,6 +349,7 @@ pub struct MsgMigrateContractResponse { pub data: ::prost::alloc::vec::Vec, } /// MsgUpdateAdmin sets a new admin for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateAdmin { /// Sender is the that actor that signed the messages @@ -323,9 +363,11 @@ pub struct MsgUpdateAdmin { pub contract: ::prost::alloc::string::String, } /// MsgUpdateAdminResponse returns empty data +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateAdminResponse {} /// MsgClearAdmin removes any admin stored for a smart contract +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgClearAdmin { /// Sender is the that actor that signed the messages @@ -336,9 +378,11 @@ pub struct MsgClearAdmin { pub contract: ::prost::alloc::string::String, } /// MsgClearAdminResponse returns empty data +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgClearAdminResponse {} /// GenesisState - genesis state of x/wasm +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, optional, tag = "1")] @@ -356,6 +400,7 @@ pub struct GenesisState { pub mod genesis_state { /// GenMsgs define the messages that can be executed during genesis phase in /// order. The intention is to have more human readable data that is auditable. + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenMsgs { /// sum is a single message @@ -365,6 +410,7 @@ pub mod genesis_state { /// Nested message and enum types in `GenMsgs`. pub mod gen_msgs { /// sum is a single message + #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { #[prost(message, tag = "1")] @@ -379,6 +425,7 @@ pub mod genesis_state { } } /// Code struct encompasses CodeInfo and CodeBytes +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Code { #[prost(uint64, tag = "1")] @@ -392,6 +439,7 @@ pub struct Code { pub pinned: bool, } /// Contract struct encompasses ContractAddress, ContractInfo, and ContractState +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Contract { #[prost(string, tag = "1")] @@ -402,6 +450,7 @@ pub struct Contract { pub contract_state: ::prost::alloc::vec::Vec, } /// Sequence key and value of an id generation counter +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Sequence { #[prost(bytes = "vec", tag = "1")] @@ -410,6 +459,7 @@ pub struct Sequence { pub value: u64, } /// MsgIBCSend +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcSend { /// the channel by which the packet will be sent @@ -429,12 +479,14 @@ pub struct MsgIbcSend { pub data: ::prost::alloc::vec::Vec, } /// MsgIBCCloseChannel port and channel need to be owned by the contract +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgIbcCloseChannel { #[prost(string, tag = "2")] pub channel: ::prost::alloc::string::String, } /// StoreCodeProposal gov proposal content type to submit WASM code to the system +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreCodeProposal { /// Title is a short summary @@ -458,6 +510,7 @@ pub struct StoreCodeProposal { } /// InstantiateContractProposal gov proposal content type to instantiate a /// contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstantiateContractProposal { /// Title is a short summary @@ -486,6 +539,7 @@ pub struct InstantiateContractProposal { pub funds: ::prost::alloc::vec::Vec, } /// MigrateContractProposal gov proposal content type to migrate a contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MigrateContractProposal { /// Title is a short summary @@ -507,6 +561,7 @@ pub struct MigrateContractProposal { pub msg: ::prost::alloc::vec::Vec, } /// SudoContractProposal gov proposal content type to call sudo on a contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SudoContractProposal { /// Title is a short summary @@ -524,6 +579,7 @@ pub struct SudoContractProposal { } /// ExecuteContractProposal gov proposal content type to call execute on a /// contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecuteContractProposal { /// Title is a short summary @@ -546,6 +602,7 @@ pub struct ExecuteContractProposal { pub funds: ::prost::alloc::vec::Vec, } /// UpdateAdminProposal gov proposal content type to set an admin for a contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateAdminProposal { /// Title is a short summary @@ -563,6 +620,7 @@ pub struct UpdateAdminProposal { } /// ClearAdminProposal gov proposal content type to clear the admin of a /// contract. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClearAdminProposal { /// Title is a short summary @@ -577,6 +635,7 @@ pub struct ClearAdminProposal { } /// PinCodesProposal gov proposal content type to pin a set of code ids in the /// wasmvm cache. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PinCodesProposal { /// Title is a short summary @@ -591,6 +650,7 @@ pub struct PinCodesProposal { } /// UnpinCodesProposal gov proposal content type to unpin a set of code ids in /// the wasmvm cache. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnpinCodesProposal { /// Title is a short summary @@ -605,6 +665,7 @@ pub struct UnpinCodesProposal { } /// AccessConfigUpdate contains the code id and the access config to be /// applied. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccessConfigUpdate { /// CodeID is the reference to the stored WASM code to be updated @@ -616,6 +677,7 @@ pub struct AccessConfigUpdate { } /// UpdateInstantiateConfigProposal gov proposal content type to update /// instantiate config to a set of code ids. +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateInstantiateConfigProposal { /// Title is a short summary @@ -631,6 +693,7 @@ pub struct UpdateInstantiateConfigProposal { } /// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractInfoRequest { /// address is the address of the contract to query @@ -639,6 +702,7 @@ pub struct QueryContractInfoRequest { } /// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC /// method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractInfoResponse { /// address is the address of the contract @@ -649,6 +713,7 @@ pub struct QueryContractInfoResponse { } /// QueryContractHistoryRequest is the request type for the Query/ContractHistory /// RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractHistoryRequest { /// address is the address of the contract to query @@ -661,6 +726,7 @@ pub struct QueryContractHistoryRequest { } /// QueryContractHistoryResponse is the response type for the /// Query/ContractHistory RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractHistoryResponse { #[prost(message, repeated, tag = "1")] @@ -672,6 +738,7 @@ pub struct QueryContractHistoryResponse { } /// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode /// RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractsByCodeRequest { /// grpc-gateway_out does not support Go style CodID @@ -684,6 +751,7 @@ pub struct QueryContractsByCodeRequest { } /// QueryContractsByCodeResponse is the response type for the /// Query/ContractsByCode RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryContractsByCodeResponse { /// contracts are a set of contract addresses @@ -696,6 +764,7 @@ pub struct QueryContractsByCodeResponse { } /// QueryAllContractStateRequest is the request type for the /// Query/AllContractState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllContractStateRequest { /// address is the address of the contract @@ -708,6 +777,7 @@ pub struct QueryAllContractStateRequest { } /// QueryAllContractStateResponse is the response type for the /// Query/AllContractState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllContractStateResponse { #[prost(message, repeated, tag = "1")] @@ -719,6 +789,7 @@ pub struct QueryAllContractStateResponse { } /// QueryRawContractStateRequest is the request type for the /// Query/RawContractState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRawContractStateRequest { /// address is the address of the contract @@ -729,6 +800,7 @@ pub struct QueryRawContractStateRequest { } /// QueryRawContractStateResponse is the response type for the /// Query/RawContractState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryRawContractStateResponse { /// Data contains the raw store data @@ -737,6 +809,7 @@ pub struct QueryRawContractStateResponse { } /// QuerySmartContractStateRequest is the request type for the /// Query/SmartContractState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySmartContractStateRequest { /// address is the address of the contract @@ -748,6 +821,7 @@ pub struct QuerySmartContractStateRequest { } /// QuerySmartContractStateResponse is the response type for the /// Query/SmartContractState RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySmartContractStateResponse { /// Data contains the json data returned from the smart contract @@ -755,6 +829,7 @@ pub struct QuerySmartContractStateResponse { pub data: ::prost::alloc::vec::Vec, } /// QueryCodeRequest is the request type for the Query/Code RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodeRequest { /// grpc-gateway_out does not support Go style CodID @@ -762,6 +837,7 @@ pub struct QueryCodeRequest { pub code_id: u64, } /// CodeInfoResponse contains code meta data from CodeInfo +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CodeInfoResponse { /// id for legacy support @@ -775,6 +851,7 @@ pub struct CodeInfoResponse { pub instantiate_permission: ::core::option::Option, } /// QueryCodeResponse is the response type for the Query/Code RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodeResponse { #[prost(message, optional, tag = "1")] @@ -783,6 +860,7 @@ pub struct QueryCodeResponse { pub data: ::prost::alloc::vec::Vec, } /// QueryCodesRequest is the request type for the Query/Codes RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodesRequest { /// pagination defines an optional pagination for the request. @@ -791,6 +869,7 @@ pub struct QueryCodesRequest { ::core::option::Option, } /// QueryCodesResponse is the response type for the Query/Codes RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryCodesResponse { #[prost(message, repeated, tag = "1")] @@ -802,6 +881,7 @@ pub struct QueryCodesResponse { } /// QueryPinnedCodesRequest is the request type for the Query/PinnedCodes /// RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPinnedCodesRequest { /// pagination defines an optional pagination for the request. @@ -811,6 +891,7 @@ pub struct QueryPinnedCodesRequest { } /// QueryPinnedCodesResponse is the response type for the /// Query/PinnedCodes RPC method +#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryPinnedCodesResponse { #[prost(uint64, repeated, packed = "false", tag = "1")] @@ -821,14 +902,17 @@ pub struct QueryPinnedCodesResponse { ::core::option::Option, } /// 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, } +include!("cosmwasm.wasm.v1.serde.rs"); include!("cosmwasm.wasm.v1.tonic.rs"); // @@protoc_insertion_point(module) 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..1820e4e7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs @@ -0,0 +1,8416 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AbsoluteTxPosition { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.block_height != 0 { + len += 1; + } + if self.tx_index != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.AbsoluteTxPosition", len)?; + if self.block_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blockHeight", + ToString::to_string(&self.block_height).as_str(), + )?; + } + if self.tx_index != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("txIndex", ToString::to_string(&self.tx_index).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AbsoluteTxPosition { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AbsoluteTxPosition") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AccessConfig { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.permission != 0 { + len += 1; + } + if !self.address.is_empty() { + len += 1; + } + if !self.addresses.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.AccessConfig", len)?; + if self.permission != 0 { + let v = AccessType::try_from(self.permission).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.permission)) + })?; + struct_ser.serialize_field("permission", &v)?; + } + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.addresses.is_empty() { + struct_ser.serialize_field("addresses", &self.addresses)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AccessConfig { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["permission", "address", "addresses"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Permission, + Address, + Addresses, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AccessConfig") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AccessConfigUpdate { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + if self.instantiate_permission.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.AccessConfigUpdate", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AccessConfigUpdate { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AccessConfigUpdate") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AccessType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AccessType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AccessTypeParam { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.value != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.AccessTypeParam", len)?; + if self.value != 0 { + let v = AccessType::try_from(self.value).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.value)) + })?; + struct_ser.serialize_field("value", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AccessTypeParam { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.AccessTypeParam") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ClearAdminProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.ClearAdminProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ClearAdminProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["title", "description", "contract"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Title, + Description, + Contract, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ClearAdminProposal") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Code { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + if self.code_info.is_some() { + len += 1; + } + if !self.code_bytes.is_empty() { + len += 1; + } + if self.pinned { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Code", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if let Some(v) = self.code_info.as_ref() { + struct_ser.serialize_field("codeInfo", v)?; + } + if !self.code_bytes.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "codeBytes", + pbjson::private::base64::encode(&self.code_bytes).as_str(), + )?; + } + if self.pinned { + struct_ser.serialize_field("pinned", &self.pinned)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Code { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Code") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CodeInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.code_hash.is_empty() { + len += 1; + } + if !self.creator.is_empty() { + len += 1; + } + if self.instantiate_config.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.CodeInfo", len)?; + if !self.code_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "codeHash", + pbjson::private::base64::encode(&self.code_hash).as_str(), + )?; + } + if !self.creator.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CodeInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.CodeInfo") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for CodeInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + if !self.creator.is_empty() { + len += 1; + } + if !self.data_hash.is_empty() { + len += 1; + } + if self.instantiate_permission.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.CodeInfoResponse", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.creator.is_empty() { + struct_ser.serialize_field("creator", &self.creator)?; + } + if !self.data_hash.is_empty() { + #[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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for CodeInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.CodeInfoResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Contract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.contract_address.is_empty() { + len += 1; + } + if self.contract_info.is_some() { + len += 1; + } + if !self.contract_state.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Contract", len)?; + if !self.contract_address.is_empty() { + struct_ser.serialize_field("contractAddress", &self.contract_address)?; + } + if let Some(v) = self.contract_info.as_ref() { + struct_ser.serialize_field("contractInfo", v)?; + } + if !self.contract_state.is_empty() { + struct_ser.serialize_field("contractState", &self.contract_state)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Contract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Contract") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ContractCodeHistoryEntry { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.operation != 0 { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if self.updated.is_some() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.ContractCodeHistoryEntry", len)?; + if self.operation != 0 { + let v = ContractCodeHistoryOperationType::try_from(self.operation).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.operation)) + })?; + struct_ser.serialize_field("operation", &v)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if let Some(v) = self.updated.as_ref() { + struct_ser.serialize_field("updated", v)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ContractCodeHistoryEntry { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ContractCodeHistoryEntry") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ContractCodeHistoryOperationType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ContractCodeHistoryOperationType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ContractInfo { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + if !self.creator.is_empty() { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + if !self.label.is_empty() { + len += 1; + } + if self.created.is_some() { + len += 1; + } + if !self.ibc_port_id.is_empty() { + len += 1; + } + if self.extension.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.ContractInfo", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.creator.is_empty() { + struct_ser.serialize_field("creator", &self.creator)?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.label.is_empty() { + struct_ser.serialize_field("label", &self.label)?; + } + if let Some(v) = self.created.as_ref() { + struct_ser.serialize_field("created", v)?; + } + if !self.ibc_port_id.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ContractInfo { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ContractInfo") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ExecuteContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.run_as.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + if !self.funds.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.ExecuteContractProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.run_as.is_empty() { + struct_ser.serialize_field("runAs", &self.run_as)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if !self.funds.is_empty() { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ExecuteContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.ExecuteContractProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.codes.is_empty() { + len += 1; + } + if !self.contracts.is_empty() { + len += 1; + } + if !self.sequences.is_empty() { + len += 1; + } + if !self.gen_msgs.is_empty() { + 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 !self.codes.is_empty() { + struct_ser.serialize_field("codes", &self.codes)?; + } + if !self.contracts.is_empty() { + struct_ser.serialize_field("contracts", &self.contracts)?; + } + if !self.sequences.is_empty() { + struct_ser.serialize_field("sequences", &self.sequences)?; + } + if !self.gen_msgs.is_empty() { + struct_ser.serialize_field("genMsgs", &self.gen_msgs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for genesis_state::GenMsgs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for genesis_state::GenMsgs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.GenesisState.GenMsgs") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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::<::std::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::<::std::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::<::std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for InstantiateContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.run_as.is_empty() { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.label.is_empty() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + if !self.funds.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.InstantiateContractProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.run_as.is_empty() { + struct_ser.serialize_field("runAs", &self.run_as)?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.label.is_empty() { + struct_ser.serialize_field("label", &self.label)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if !self.funds.is_empty() { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InstantiateContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.InstantiateContractProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MigrateContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MigrateContractProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MigrateContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MigrateContractProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Model { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Model", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "value", + pbjson::private::base64::encode(&self.value).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Model { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Model") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgClearAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgClearAdmin", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgClearAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sender", "contract"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sender, + Contract, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgClearAdmin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgClearAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgClearAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgClearAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExecuteContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + if !self.funds.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgExecuteContract", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if !self.funds.is_empty() { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExecuteContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgExecuteContract") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgExecuteContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgExecuteContractResponse", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgExecuteContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgExecuteContractResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgIbcCloseChannel { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.channel.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgIBCCloseChannel", len)?; + if !self.channel.is_empty() { + struct_ser.serialize_field("channel", &self.channel)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgIbcCloseChannel { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["channel"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channel, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgIBCCloseChannel") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgIbcSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.channel.is_empty() { + len += 1; + } + if self.timeout_height != 0 { + len += 1; + } + if self.timeout_timestamp != 0 { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgIBCSend", len)?; + if !self.channel.is_empty() { + struct_ser.serialize_field("channel", &self.channel)?; + } + if self.timeout_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "timeoutHeight", + ToString::to_string(&self.timeout_height).as_str(), + )?; + } + if self.timeout_timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "timeoutTimestamp", + ToString::to_string(&self.timeout_timestamp).as_str(), + )?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgIbcSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgIBCSend") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgInstantiateContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.label.is_empty() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + if !self.funds.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.label.is_empty() { + struct_ser.serialize_field("label", &self.label)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if !self.funds.is_empty() { + struct_ser.serialize_field("funds", &self.funds)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgInstantiateContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContract") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgInstantiateContract2 { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.label.is_empty() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + if !self.funds.is_empty() { + len += 1; + } + if !self.salt.is_empty() { + len += 1; + } + if self.fix_msg { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract2", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.label.is_empty() { + struct_ser.serialize_field("label", &self.label)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + if !self.funds.is_empty() { + struct_ser.serialize_field("funds", &self.funds)?; + } + if !self.salt.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("salt", pbjson::private::base64::encode(&self.salt).as_str())?; + } + if self.fix_msg { + struct_ser.serialize_field("fixMsg", &self.fix_msg)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgInstantiateContract2 { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContract2") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgInstantiateContract2Response { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgInstantiateContract2Response", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgInstantiateContract2Response { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContract2Response") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgInstantiateContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgInstantiateContractResponse", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgInstantiateContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgInstantiateContractResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMigrateContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + if self.code_id != 0 { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgMigrateContract", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMigrateContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgMigrateContract") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMigrateContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgMigrateContractResponse", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMigrateContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgMigrateContractResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgStoreCode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.wasm_byte_code.is_empty() { + len += 1; + } + if self.instantiate_permission.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgStoreCode", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.wasm_byte_code.is_empty() { + #[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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgStoreCode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreCode") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgStoreCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + if !self.checksum.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.MsgStoreCodeResponse", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + if !self.checksum.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "checksum", + pbjson::private::base64::encode(&self.checksum).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgStoreCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["code_id", "codeId", "checksum"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + Checksum, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgStoreCodeResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateAdmin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sender.is_empty() { + len += 1; + } + if !self.new_admin.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.MsgUpdateAdmin", len)?; + if !self.sender.is_empty() { + struct_ser.serialize_field("sender", &self.sender)?; + } + if !self.new_admin.is_empty() { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateAdmin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateAdmin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateAdminResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateAdminResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgUpdateAdminResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_upload_access.is_some() { + len += 1; + } + if self.instantiate_default_permission != 0 { + 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 self.instantiate_default_permission != 0 { + let v = AccessType::try_from(self.instantiate_default_permission).map_err(|_| { + serde::ser::Error::custom(format!( + "Invalid variant {}", + self.instantiate_default_permission + )) + })?; + struct_ser.serialize_field("instantiateDefaultPermission", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PinCodesProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.code_ids.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.PinCodesProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.code_ids.is_empty() { + struct_ser.serialize_field( + "codeIds", + &self + .code_ids + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PinCodesProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.PinCodesProposal") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllContractStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryAllContractStateRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllContractStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryAllContractStateRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllContractStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.models.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryAllContractStateResponse", len)?; + if !self.models.is_empty() { + struct_ser.serialize_field("models", &self.models)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllContractStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["models", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Models, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryAllContractStateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryCodeRequest", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", ToString::to_string(&self.code_id).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["code_id", "codeId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodeRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_info.is_some() { + len += 1; + } + if !self.data.is_empty() { + 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 !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["code_info", "codeInfo", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeInfo, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodeResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCodesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCodesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodesRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCodesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.code_infos.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryCodesResponse", len)?; + if !self.code_infos.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCodesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["code_infos", "codeInfos", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeInfos, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryCodesResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContractHistoryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractHistoryRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContractHistoryRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractHistoryRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContractHistoryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.entries.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractHistoryResponse", len)?; + if !self.entries.is_empty() { + struct_ser.serialize_field("entries", &self.entries)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContractHistoryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["entries", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Entries, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractHistoryResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContractInfoRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractInfoRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContractInfoRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractInfoRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContractInfoResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.contract_info.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractInfoResponse", len)?; + if !self.address.is_empty() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContractInfoResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "contract_info", "contractInfo"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + ContractInfo, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractInfoResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContractsByCodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.code_id != 0 { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractsByCodeRequest", len)?; + if self.code_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("codeId", 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContractsByCodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["code_id", "codeId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeId, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractsByCodeRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContractsByCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.contracts.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryContractsByCodeResponse", len)?; + if !self.contracts.is_empty() { + struct_ser.serialize_field("contracts", &self.contracts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContractsByCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["contracts", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Contracts, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryContractsByCodeResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPinnedCodesRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + 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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPinnedCodesRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryPinnedCodesRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPinnedCodesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.code_ids.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryPinnedCodesResponse", len)?; + if !self.code_ids.is_empty() { + struct_ser.serialize_field( + "codeIds", + &self + .code_ids + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPinnedCodesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["code_ids", "codeIds", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeIds, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryPinnedCodesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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::>>()? + .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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryRawContractStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.query_data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryRawContractStateRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.query_data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "queryData", + pbjson::private::base64::encode(&self.query_data).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryRawContractStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "query_data", "queryData"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + QueryData, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryRawContractStateRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryRawContractStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryRawContractStateResponse", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryRawContractStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryRawContractStateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySmartContractStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.query_data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QuerySmartContractStateRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.query_data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "queryData", + pbjson::private::base64::encode(&self.query_data).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySmartContractStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "query_data", "queryData"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + QueryData, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QuerySmartContractStateRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QuerySmartContractStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QuerySmartContractStateResponse", len)?; + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QuerySmartContractStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QuerySmartContractStateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Sequence { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.id_key.is_empty() { + len += 1; + } + if self.value != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmwasm.wasm.v1.Sequence", len)?; + if !self.id_key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "idKey", + pbjson::private::base64::encode(&self.id_key).as_str(), + )?; + } + if self.value != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", ToString::to_string(&self.value).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Sequence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["id_key", "idKey", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + IdKey, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.Sequence") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StoreCodeProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.run_as.is_empty() { + len += 1; + } + if !self.wasm_byte_code.is_empty() { + len += 1; + } + if self.instantiate_permission.is_some() { + len += 1; + } + if self.unpin_code { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.StoreCodeProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.run_as.is_empty() { + struct_ser.serialize_field("runAs", &self.run_as)?; + } + if !self.wasm_byte_code.is_empty() { + #[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 self.unpin_code { + struct_ser.serialize_field("unpinCode", &self.unpin_code)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StoreCodeProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.StoreCodeProposal") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SudoContractProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + if !self.msg.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.SudoContractProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SudoContractProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.SudoContractProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for UnpinCodesProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.code_ids.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.UnpinCodesProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.code_ids.is_empty() { + struct_ser.serialize_field( + "codeIds", + &self + .code_ids + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for UnpinCodesProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.UnpinCodesProposal") + } + + fn visit_map(self, mut map_: V) -> std::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::>>()? + .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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for UpdateAdminProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.new_admin.is_empty() { + len += 1; + } + if !self.contract.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.UpdateAdminProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.new_admin.is_empty() { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + if !self.contract.is_empty() { + struct_ser.serialize_field("contract", &self.contract)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for UpdateAdminProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.UpdateAdminProposal") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for UpdateInstantiateConfigProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.title.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.access_config_updates.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.UpdateInstantiateConfigProposal", len)?; + if !self.title.is_empty() { + struct_ser.serialize_field("title", &self.title)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.access_config_updates.is_empty() { + struct_ser.serialize_field("accessConfigUpdates", &self.access_config_updates)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for UpdateInstantiateConfigProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.UpdateInstantiateConfigProposal") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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/prost/xion/XION_COMMIT b/cosmos-sdk-proto/src/prost/xion/XION_COMMIT new file mode 100644 index 00000000..88d050b1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/XION_COMMIT @@ -0,0 +1 @@ +main \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/xion/amino.rs b/cosmos-sdk-proto/src/prost/xion/amino.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/amino.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/cosmos.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.bank.v1beta1.rs new file mode 100644 index 00000000..c5253b32 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.bank.v1beta1.rs @@ -0,0 +1,114 @@ +// @generated +/// Params defines the parameters for the bank module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// Deprecated: Use of SendEnabled in params is deprecated. + /// For genesis, use the newly added send_enabled field in the genesis object. + /// Storage, lookup, and manipulation of this information is now in the keeper. + /// + /// As of cosmos-sdk 0.47, this only exists for backwards compatibility of genesis files. + #[deprecated] + #[prost(message, repeated, tag = "1")] + pub send_enabled: ::prost::alloc::vec::Vec, + #[prost(bool, tag = "2")] + pub default_send_enabled: bool, +} +/// SendEnabled maps coin denom to a send_enabled status (whether a denom is +/// sendable). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SendEnabled { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + #[prost(bool, tag = "2")] + pub enabled: bool, +} +/// Input models transaction input. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Input { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// Output models transaction outputs. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Output { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +/// Supply represents a struct that passively keeps track of the total supply +/// amounts in the network. +/// This message is deprecated now that supply is indexed by denom. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Supply { + #[prost(message, repeated, tag = "1")] + pub total: ::prost::alloc::vec::Vec, +} +/// DenomUnit represents a struct that describes a given +/// denomination unit of the basic token. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DenomUnit { + /// denom represents the string name of the given denom unit (e.g uatom). + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// exponent represents power of 10 exponent that one must + /// raise the base_denom to in order to equal the given DenomUnit's denom + /// 1 denom = 10^exponent base_denom + /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with + /// exponent = 6, thus: 1 atom = 10^6 uatom). + #[prost(uint32, tag = "2")] + pub exponent: u32, + /// aliases is a list of string aliases for the given denom + #[prost(string, repeated, tag = "3")] + pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Metadata represents a struct that describes +/// a basic token. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Metadata { + #[prost(string, tag = "1")] + pub description: ::prost::alloc::string::String, + /// denom_units represents the list of DenomUnit's for a given coin + #[prost(message, repeated, tag = "2")] + pub denom_units: ::prost::alloc::vec::Vec, + /// base represents the base denom (should be the DenomUnit with exponent = 0). + #[prost(string, tag = "3")] + pub base: ::prost::alloc::string::String, + /// display indicates the suggested denom that should be + /// displayed in clients. + #[prost(string, tag = "4")] + pub display: ::prost::alloc::string::String, + /// name defines the name of the token (eg: Cosmos Atom) + /// + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "5")] + pub name: ::prost::alloc::string::String, + /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can + /// be the same as the display. + /// + /// Since: cosmos-sdk 0.43 + #[prost(string, tag = "6")] + pub symbol: ::prost::alloc::string::String, + /// URI to a document (on or off-chain) that contains additional information. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "7")] + pub uri: ::prost::alloc::string::String, + /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + /// the document didn't change. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "8")] + pub uri_hash: ::prost::alloc::string::String, +} +include!("cosmos.bank.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/cosmos.bank.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.bank.v1beta1.serde.rs new file mode 100644 index 00000000..d870e2d9 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.bank.v1beta1.serde.rs @@ -0,0 +1,897 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for DenomUnit { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.exponent != 0 { + len += 1; + } + if !self.aliases.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.DenomUnit", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if self.exponent != 0 { + struct_ser.serialize_field("exponent", &self.exponent)?; + } + if !self.aliases.is_empty() { + struct_ser.serialize_field("aliases", &self.aliases)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DenomUnit { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "exponent", "aliases"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Exponent, + Aliases, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.DenomUnit") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Input { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Input", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Input { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Input") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Metadata { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.description.is_empty() { + len += 1; + } + if !self.denom_units.is_empty() { + len += 1; + } + if !self.base.is_empty() { + len += 1; + } + if !self.display.is_empty() { + len += 1; + } + if !self.name.is_empty() { + len += 1; + } + if !self.symbol.is_empty() { + len += 1; + } + if !self.uri.is_empty() { + len += 1; + } + if !self.uri_hash.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Metadata", len)?; + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.denom_units.is_empty() { + struct_ser.serialize_field("denomUnits", &self.denom_units)?; + } + if !self.base.is_empty() { + struct_ser.serialize_field("base", &self.base)?; + } + if !self.display.is_empty() { + struct_ser.serialize_field("display", &self.display)?; + } + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.symbol.is_empty() { + struct_ser.serialize_field("symbol", &self.symbol)?; + } + if !self.uri.is_empty() { + struct_ser.serialize_field("uri", &self.uri)?; + } + if !self.uri_hash.is_empty() { + struct_ser.serialize_field("uriHash", &self.uri_hash)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Metadata { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Metadata") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Output { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if !self.coins.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Output", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if !self.coins.is_empty() { + struct_ser.serialize_field("coins", &self.coins)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Output { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "coins"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Coins, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Output") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.send_enabled.is_empty() { + len += 1; + } + if self.default_send_enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Params", len)?; + if !self.send_enabled.is_empty() { + struct_ser.serialize_field("sendEnabled", &self.send_enabled)?; + } + if self.default_send_enabled { + struct_ser.serialize_field("defaultSendEnabled", &self.default_send_enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SendEnabled { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.enabled { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.SendEnabled", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if self.enabled { + struct_ser.serialize_field("enabled", &self.enabled)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SendEnabled { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "enabled"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Enabled, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.SendEnabled") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Supply { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.total.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.Supply", len)?; + if !self.total.is_empty() { + struct_ser.serialize_field("total", &self.total)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Supply { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.Supply") + } + + fn visit_map(self, mut map_: V) -> std::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/xion/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.base.query.v1beta1.rs new file mode 100644 index 00000000..9e79d078 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.base.query.v1beta1.rs @@ -0,0 +1,59 @@ +// @generated +/// PageRequest is to be embedded in gRPC request messages for efficient +/// pagination. Ex: +/// +/// message SomeRequest { +/// Foo some_parameter = 1; +/// PageRequest pagination = 2; +/// } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageRequest { + /// key is a value returned in PageResponse.next_key to begin + /// querying the next page most efficiently. Only one of offset or key + /// should be set. + #[prost(bytes = "vec", tag = "1")] + pub key: ::prost::alloc::vec::Vec, + /// offset is a numeric offset that can be used when key is unavailable. + /// It is less efficient than using key. Only one of offset or key should + /// be set. + #[prost(uint64, tag = "2")] + pub offset: u64, + /// limit is the total number of results to be returned in the result page. + /// If left empty it will default to a value to be set by each app. + #[prost(uint64, tag = "3")] + pub limit: u64, + /// count_total is set to true to indicate that the result set should include + /// a count of the total number of items available for pagination in UIs. + /// count_total is only respected when offset is used. It is ignored when key + /// is set. + #[prost(bool, tag = "4")] + pub count_total: bool, + /// reverse is set to true if results are to be returned in the descending order. + /// + /// Since: cosmos-sdk 0.43 + #[prost(bool, tag = "5")] + pub reverse: bool, +} +/// PageResponse is to be embedded in gRPC response messages where the +/// corresponding request message has used PageRequest. +/// +/// message SomeResponse { +/// repeated Bar results = 1; +/// PageResponse page = 2; +/// } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PageResponse { + /// next_key is the key to be passed to PageRequest.key to + /// query the next page most efficiently. It will be empty if + /// there are no more results. + #[prost(bytes = "vec", tag = "1")] + pub next_key: ::prost::alloc::vec::Vec, + /// total is total number of results available if PageRequest.count_total + /// was set, its value is undefined otherwise + #[prost(uint64, tag = "2")] + pub total: u64, +} +include!("cosmos.base.query.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/cosmos.base.query.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.base.query.v1beta1.serde.rs new file mode 100644 index 00000000..27639f3d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.base.query.v1beta1.serde.rs @@ -0,0 +1,312 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for PageRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if self.offset != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + if self.count_total { + len += 1; + } + if self.reverse { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageRequest", len)?; + if !self.key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; + } + if self.offset != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("offset", ToString::to_string(&self.offset).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + if self.count_total { + struct_ser.serialize_field("countTotal", &self.count_total)?; + } + if self.reverse { + struct_ser.serialize_field("reverse", &self.reverse)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageRequest") + } + + fn visit_map(self, mut map_: V) -> std::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, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PageResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.next_key.is_empty() { + len += 1; + } + if self.total != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.query.v1beta1.PageResponse", len)?; + if !self.next_key.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextKey", + pbjson::private::base64::encode(&self.next_key).as_str(), + )?; + } + if self.total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("total", ToString::to_string(&self.total).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PageResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["next_key", "nextKey", "total"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextKey, + Total, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.query.v1beta1.PageResponse") + } + + fn visit_map(self, mut map_: V) -> std::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/xion/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.base.v1beta1.rs new file mode 100644 index 00000000..8a02bbd7 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.base.v1beta1.rs @@ -0,0 +1,41 @@ +// @generated +/// 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, +} +include!("cosmos.base.v1beta1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/cosmos.base.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.base.v1beta1.serde.rs new file mode 100644 index 00000000..92880130 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.base.v1beta1.serde.rs @@ -0,0 +1,413 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Coin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.Coin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Coin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.Coin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecCoin { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecCoin", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecCoin { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecCoin") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DecProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.dec.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecProto", len)?; + if !self.dec.is_empty() { + struct_ser.serialize_field("dec", &self.dec)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DecProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["dec"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Dec, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.DecProto") + } + + fn visit_map(self, mut map_: V) -> std::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) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for IntProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.int.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.IntProto", len)?; + if !self.int.is_empty() { + struct_ser.serialize_field("int", &self.int)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for IntProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["int"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Int, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.v1beta1.IntProto") + } + + fn visit_map(self, mut map_: V) -> std::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/xion/cosmos.msg.v1.rs b/cosmos-sdk-proto/src/prost/xion/cosmos.msg.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos.msg.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/xion/cosmos_proto.rs new file mode 100644 index 00000000..2353a154 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos_proto.rs @@ -0,0 +1,76 @@ +// @generated +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterfaceDescriptor { + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScalarDescriptor { + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + #[prost(enumeration = "ScalarType", repeated, tag = "3")] + pub field_type: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ScalarType { + Unspecified = 0, + String = 1, + Bytes = 2, +} +impl ScalarType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + ScalarType::String => "SCALAR_TYPE_STRING", + ScalarType::Bytes => "SCALAR_TYPE_BYTES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SCALAR_TYPE_STRING" => Some(Self::String), + "SCALAR_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } +} +include!("cosmos_proto.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/cosmos_proto.serde.rs b/cosmos-sdk-proto/src/prost/xion/cosmos_proto.serde.rs new file mode 100644 index 00000000..0ebdf0ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/cosmos_proto.serde.rs @@ -0,0 +1,334 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos_proto.InterfaceDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "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 = InterfaceDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(InterfaceDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos_proto.InterfaceDescriptor", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.field_type.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos_proto.ScalarDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.field_type.is_empty() { + let v = self + .field_type + .iter() + .cloned() + .map(|v| { + ScalarType::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }) + .collect::, _>>()?; + struct_ser.serialize_field("fieldType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description", "field_type", "fieldType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + FieldType, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + "fieldType" | "field_type" => Ok(GeneratedField::FieldType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.ScalarDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + let mut field_type__ = 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::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::FieldType => { + if field_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldType")); + } + field_type__ = Some( + map_.next_value::>()? + .into_iter() + .map(|x| x as i32) + .collect(), + ); + } + } + } + Ok(ScalarDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + field_type: field_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos_proto.ScalarDescriptor", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCALAR_TYPE_UNSPECIFIED", + "SCALAR_TYPE_STRING", + "SCALAR_TYPE_BYTES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarType; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Ok(ScalarType::Unspecified), + "SCALAR_TYPE_STRING" => Ok(ScalarType::String), + "SCALAR_TYPE_BYTES" => Ok(ScalarType::Bytes), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.rs b/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.rs new file mode 100644 index 00000000..3c53c018 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.rs @@ -0,0 +1,47 @@ +// @generated +/// GenesisState - initial state of module +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// Params of this module + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +/// Params defines the set of module parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// minimum_gas_prices stores the minimum gas price(s) for all TX on the chain. + /// When multiple coins are defined then they are accepted alternatively. + /// The list must be sorted by denoms asc. No duplicate denoms or zero amount + /// values allowed. For more information see + /// + #[prost(message, repeated, tag = "1")] + pub minimum_gas_prices: + ::prost::alloc::vec::Vec, + /// bypass_min_fee_msg_types defines a list of message type urls + /// that are free of fee charge. + #[prost(string, repeated, tag = "2")] + pub bypass_min_fee_msg_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// max_total_bypass_min_fee_msg_gas_usage defines the total maximum gas usage + /// allowed for a transaction containing only messages of types in + /// bypass_min_fee_msg_types to bypass fee charge. + #[prost(uint64, tag = "3")] + pub max_total_bypass_min_fee_msg_gas_usage: u64, +} +/// QueryMinimumGasPricesRequest is the request type for the +/// Query/MinimumGasPrices RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryMinimumGasPricesResponse is the response type for the +/// Query/MinimumGasPrices RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +include!("xion.globalfee.v1.serde.rs"); +include!("xion.globalfee.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.serde.rs b/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.serde.rs new file mode 100644 index 00000000..ce46f5a1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.serde.rs @@ -0,0 +1,424 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.globalfee.v1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = GenesisState; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.globalfee.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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(GenesisState { params: params__ }) + } + } + deserializer.deserialize_struct("xion.globalfee.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.minimum_gas_prices.is_empty() { + len += 1; + } + if !self.bypass_min_fee_msg_types.is_empty() { + len += 1; + } + if self.max_total_bypass_min_fee_msg_gas_usage != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.globalfee.v1.Params", len)?; + if !self.minimum_gas_prices.is_empty() { + struct_ser.serialize_field("minimumGasPrices", &self.minimum_gas_prices)?; + } + if !self.bypass_min_fee_msg_types.is_empty() { + struct_ser.serialize_field("bypassMinFeeMsgTypes", &self.bypass_min_fee_msg_types)?; + } + if self.max_total_bypass_min_fee_msg_gas_usage != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "maxTotalBypassMinFeeMsgGasUsage", + ToString::to_string(&self.max_total_bypass_min_fee_msg_gas_usage).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "minimum_gas_prices", + "minimumGasPrices", + "bypass_min_fee_msg_types", + "bypassMinFeeMsgTypes", + "max_total_bypass_min_fee_msg_gas_usage", + "maxTotalBypassMinFeeMsgGasUsage", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + MinimumGasPrices, + BypassMinFeeMsgTypes, + MaxTotalBypassMinFeeMsgGasUsage, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "minimumGasPrices" | "minimum_gas_prices" => { + Ok(GeneratedField::MinimumGasPrices) + } + "bypassMinFeeMsgTypes" | "bypass_min_fee_msg_types" => { + Ok(GeneratedField::BypassMinFeeMsgTypes) + } + "maxTotalBypassMinFeeMsgGasUsage" + | "max_total_bypass_min_fee_msg_gas_usage" => { + Ok(GeneratedField::MaxTotalBypassMinFeeMsgGasUsage) + } + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.globalfee.v1.Params") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut minimum_gas_prices__ = None; + let mut bypass_min_fee_msg_types__ = None; + let mut max_total_bypass_min_fee_msg_gas_usage__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::MinimumGasPrices => { + if minimum_gas_prices__.is_some() { + return Err(serde::de::Error::duplicate_field("minimumGasPrices")); + } + minimum_gas_prices__ = Some(map_.next_value()?); + } + GeneratedField::BypassMinFeeMsgTypes => { + if bypass_min_fee_msg_types__.is_some() { + return Err(serde::de::Error::duplicate_field( + "bypassMinFeeMsgTypes", + )); + } + bypass_min_fee_msg_types__ = Some(map_.next_value()?); + } + GeneratedField::MaxTotalBypassMinFeeMsgGasUsage => { + if max_total_bypass_min_fee_msg_gas_usage__.is_some() { + return Err(serde::de::Error::duplicate_field( + "maxTotalBypassMinFeeMsgGasUsage", + )); + } + max_total_bypass_min_fee_msg_gas_usage__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Params { + minimum_gas_prices: minimum_gas_prices__.unwrap_or_default(), + bypass_min_fee_msg_types: bypass_min_fee_msg_types__.unwrap_or_default(), + max_total_bypass_min_fee_msg_gas_usage: + max_total_bypass_min_fee_msg_gas_usage__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.globalfee.v1.Params", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.globalfee.v1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.globalfee.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest {}) + } + } + deserializer.deserialize_struct( + "xion.globalfee.v1.QueryParamsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.globalfee.v1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.globalfee.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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( + "xion.globalfee.v1.QueryParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.tonic.rs b/cosmos-sdk-proto/src/prost/xion/xion.globalfee.v1.tonic.rs new file mode 100644 index 00000000..6bd5b44b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.globalfee.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 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("/xion.globalfee.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.globalfee.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() { + "/xion.globalfee.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 = "xion.globalfee.v1.Query"; + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.rs b/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.rs new file mode 100644 index 00000000..08f2fe1d --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.rs @@ -0,0 +1,183 @@ +// @generated +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Audience { + #[prost(string, tag = "1")] + pub aud: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub admin: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AudienceClaim { + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, +} +/// Params defines the parameters for the module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// in nanoseconds + #[prost(uint64, tag = "1")] + pub time_offset: u64, + /// gas to deploy a new project/audience + #[prost(uint64, tag = "2")] + pub deployment_gas: u64, +} +/// GenesisState defines the jwk module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + #[prost(message, repeated, tag = "2")] + pub audience_list: ::prost::alloc::vec::Vec, +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetAudienceClaimRequest { + #[prost(bytes = "vec", tag = "1")] + pub hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetAudienceClaimResponse { + #[prost(message, optional, tag = "1")] + pub claim: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetAudienceRequest { + #[prost(string, tag = "1")] + pub aud: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetAudienceResponse { + #[prost(message, optional, tag = "1")] + pub audience: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllAudienceRequest { + #[prost(message, optional, tag = "1")] + pub pagination: + ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllAudienceResponse { + #[prost(message, repeated, tag = "1")] + pub audience: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: + ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryValidateJwtRequest { + #[prost(string, tag = "1")] + pub aud: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub sub: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub sig_bytes: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PrivateClaim { + #[prost(string, tag = "1")] + pub key: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub value: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryValidateJwtResponse { + #[prost(message, repeated, tag = "1")] + pub private_claims: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateAudienceClaim { + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub aud_hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateAudienceClaimResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeleteAudienceClaim { + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub aud_hash: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeleteAudienceClaimResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateAudience { + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub aud: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub key: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateAudienceResponse { + #[prost(message, optional, tag = "1")] + pub audience: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateAudience { + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub new_admin: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub aud: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub key: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateAudienceResponse { + #[prost(message, optional, tag = "1")] + pub audience: ::core::option::Option, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeleteAudience { + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub aud: ::prost::alloc::string::String, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeleteAudienceResponse {} +include!("xion.jwk.v1.serde.rs"); +include!("xion.jwk.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.serde.rs b/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.serde.rs new file mode 100644 index 00000000..d079dcee --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.serde.rs @@ -0,0 +1,2702 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Audience { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.aud.is_empty() { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + if !self.admin.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.Audience", len)?; + if !self.aud.is_empty() { + struct_ser.serialize_field("aud", &self.aud)?; + } + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Audience { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["aud", "key", "admin"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Aud, + Key, + Admin, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "aud" => Ok(GeneratedField::Aud), + "key" => Ok(GeneratedField::Key), + "admin" => Ok(GeneratedField::Admin), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Audience; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.Audience") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut aud__ = None; + let mut key__ = None; + let mut admin__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Aud => { + if aud__.is_some() { + return Err(serde::de::Error::duplicate_field("aud")); + } + aud__ = Some(map_.next_value()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = Some(map_.next_value()?); + } + GeneratedField::Admin => { + if admin__.is_some() { + return Err(serde::de::Error::duplicate_field("admin")); + } + admin__ = Some(map_.next_value()?); + } + } + } + Ok(Audience { + aud: aud__.unwrap_or_default(), + key: key__.unwrap_or_default(), + admin: admin__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.Audience", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AudienceClaim { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.AudienceClaim", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AudienceClaim { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signer"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AudienceClaim; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.AudienceClaim") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(AudienceClaim { + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.AudienceClaim", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + if !self.audience_list.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.GenesisState", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + if !self.audience_list.is_empty() { + struct_ser.serialize_field("audienceList", &self.audience_list)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params", "audienceList"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + AudienceList, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + "audienceList" => Ok(GeneratedField::AudienceList), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + let mut audience_list__ = 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::AudienceList => { + if audience_list__.is_some() { + return Err(serde::de::Error::duplicate_field("audienceList")); + } + audience_list__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + params: params__, + audience_list: audience_list__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateAudience { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.aud.is_empty() { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.MsgCreateAudience", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.aud.is_empty() { + struct_ser.serialize_field("aud", &self.aud)?; + } + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateAudience { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "aud", "key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Aud, + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "aud" => Ok(GeneratedField::Aud), + "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 = MsgCreateAudience; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgCreateAudience") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut aud__ = None; + let mut key__ = 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::Aud => { + if aud__.is_some() { + return Err(serde::de::Error::duplicate_field("aud")); + } + aud__ = Some(map_.next_value()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCreateAudience { + admin: admin__.unwrap_or_default(), + aud: aud__.unwrap_or_default(), + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.MsgCreateAudience", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateAudienceClaim { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.aud_hash.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgCreateAudienceClaim", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.aud_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "audHash", + pbjson::private::base64::encode(&self.aud_hash).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateAudienceClaim { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "aud_hash", "audHash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + AudHash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "audHash" | "aud_hash" => Ok(GeneratedField::AudHash), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateAudienceClaim; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgCreateAudienceClaim") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut aud_hash__ = 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::AudHash => { + if aud_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("audHash")); + } + aud_hash__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(MsgCreateAudienceClaim { + admin: admin__.unwrap_or_default(), + aud_hash: aud_hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgCreateAudienceClaim", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateAudienceClaimResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgCreateAudienceClaimResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateAudienceClaimResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateAudienceClaimResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgCreateAudienceClaimResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgCreateAudienceClaimResponse {}) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgCreateAudienceClaimResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateAudienceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.audience.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgCreateAudienceResponse", len)?; + if let Some(v) = self.audience.as_ref() { + struct_ser.serialize_field("audience", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateAudienceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["audience"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Audience, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "audience" => Ok(GeneratedField::Audience), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateAudienceResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgCreateAudienceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut audience__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Audience => { + if audience__.is_some() { + return Err(serde::de::Error::duplicate_field("audience")); + } + audience__ = map_.next_value()?; + } + } + } + Ok(MsgCreateAudienceResponse { + audience: audience__, + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgCreateAudienceResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDeleteAudience { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.aud.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.MsgDeleteAudience", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.aud.is_empty() { + struct_ser.serialize_field("aud", &self.aud)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDeleteAudience { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "aud"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + Aud, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "aud" => Ok(GeneratedField::Aud), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDeleteAudience; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgDeleteAudience") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut aud__ = 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::Aud => { + if aud__.is_some() { + return Err(serde::de::Error::duplicate_field("aud")); + } + aud__ = Some(map_.next_value()?); + } + } + } + Ok(MsgDeleteAudience { + admin: admin__.unwrap_or_default(), + aud: aud__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.MsgDeleteAudience", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDeleteAudienceClaim { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.aud_hash.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgDeleteAudienceClaim", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.aud_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "audHash", + pbjson::private::base64::encode(&self.aud_hash).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDeleteAudienceClaim { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "aud_hash", "audHash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + AudHash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "audHash" | "aud_hash" => Ok(GeneratedField::AudHash), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDeleteAudienceClaim; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgDeleteAudienceClaim") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut aud_hash__ = 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::AudHash => { + if aud_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("audHash")); + } + aud_hash__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(MsgDeleteAudienceClaim { + admin: admin__.unwrap_or_default(), + aud_hash: aud_hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgDeleteAudienceClaim", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDeleteAudienceClaimResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgDeleteAudienceClaimResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDeleteAudienceClaimResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDeleteAudienceClaimResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgDeleteAudienceClaimResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgDeleteAudienceClaimResponse {}) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgDeleteAudienceClaimResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDeleteAudienceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgDeleteAudienceResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDeleteAudienceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgDeleteAudienceResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgDeleteAudienceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgDeleteAudienceResponse {}) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgDeleteAudienceResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateAudience { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.admin.is_empty() { + len += 1; + } + if !self.new_admin.is_empty() { + len += 1; + } + if !self.aud.is_empty() { + len += 1; + } + if !self.key.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.MsgUpdateAudience", len)?; + if !self.admin.is_empty() { + struct_ser.serialize_field("admin", &self.admin)?; + } + if !self.new_admin.is_empty() { + struct_ser.serialize_field("newAdmin", &self.new_admin)?; + } + if !self.aud.is_empty() { + struct_ser.serialize_field("aud", &self.aud)?; + } + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateAudience { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["admin", "new_admin", "newAdmin", "aud", "key"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Admin, + NewAdmin, + Aud, + Key, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "admin" => Ok(GeneratedField::Admin), + "newAdmin" | "new_admin" => Ok(GeneratedField::NewAdmin), + "aud" => Ok(GeneratedField::Aud), + "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 = MsgUpdateAudience; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgUpdateAudience") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut admin__ = None; + let mut new_admin__ = None; + let mut aud__ = None; + let mut key__ = 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::NewAdmin => { + if new_admin__.is_some() { + return Err(serde::de::Error::duplicate_field("newAdmin")); + } + new_admin__ = Some(map_.next_value()?); + } + GeneratedField::Aud => { + if aud__.is_some() { + return Err(serde::de::Error::duplicate_field("aud")); + } + aud__ = Some(map_.next_value()?); + } + GeneratedField::Key => { + if key__.is_some() { + return Err(serde::de::Error::duplicate_field("key")); + } + key__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpdateAudience { + admin: admin__.unwrap_or_default(), + new_admin: new_admin__.unwrap_or_default(), + aud: aud__.unwrap_or_default(), + key: key__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.MsgUpdateAudience", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateAudienceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.audience.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.MsgUpdateAudienceResponse", len)?; + if let Some(v) = self.audience.as_ref() { + struct_ser.serialize_field("audience", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateAudienceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["audience"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Audience, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "audience" => Ok(GeneratedField::Audience), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateAudienceResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.MsgUpdateAudienceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut audience__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Audience => { + if audience__.is_some() { + return Err(serde::de::Error::duplicate_field("audience")); + } + audience__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateAudienceResponse { + audience: audience__, + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.MsgUpdateAudienceResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.time_offset != 0 { + len += 1; + } + if self.deployment_gas != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.Params", len)?; + if self.time_offset != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "timeOffset", + ToString::to_string(&self.time_offset).as_str(), + )?; + } + if self.deployment_gas != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "deploymentGas", + ToString::to_string(&self.deployment_gas).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "time_offset", + "timeOffset", + "deployment_gas", + "deploymentGas", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TimeOffset, + DeploymentGas, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "timeOffset" | "time_offset" => Ok(GeneratedField::TimeOffset), + "deploymentGas" | "deployment_gas" => Ok(GeneratedField::DeploymentGas), + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.Params") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut time_offset__ = None; + let mut deployment_gas__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TimeOffset => { + if time_offset__.is_some() { + return Err(serde::de::Error::duplicate_field("timeOffset")); + } + time_offset__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::DeploymentGas => { + if deployment_gas__.is_some() { + return Err(serde::de::Error::duplicate_field("deploymentGas")); + } + deployment_gas__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Params { + time_offset: time_offset__.unwrap_or_default(), + deployment_gas: deployment_gas__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.Params", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for PrivateClaim { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.key.is_empty() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.PrivateClaim", len)?; + if !self.key.is_empty() { + struct_ser.serialize_field("key", &self.key)?; + } + if !self.value.is_empty() { + struct_ser.serialize_field("value", &self.value)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for PrivateClaim { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["key", "value"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Key, + Value, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = PrivateClaim; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.PrivateClaim") + } + + fn visit_map(self, mut map_: V) -> std::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(PrivateClaim { + key: key__.unwrap_or_default(), + value: value__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.jwk.v1.PrivateClaim", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllAudienceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryAllAudienceRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllAudienceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryAllAudienceRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryAllAudienceRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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(QueryAllAudienceRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryAllAudienceRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAllAudienceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.audience.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryAllAudienceResponse", len)?; + if !self.audience.is_empty() { + struct_ser.serialize_field("audience", &self.audience)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAllAudienceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["audience", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Audience, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "audience" => Ok(GeneratedField::Audience), + "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 = QueryAllAudienceResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryAllAudienceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut audience__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Audience => { + if audience__.is_some() { + return Err(serde::de::Error::duplicate_field("audience")); + } + audience__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAllAudienceResponse { + audience: audience__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryAllAudienceResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGetAudienceClaimRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.hash.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryGetAudienceClaimRequest", len)?; + if !self.hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGetAudienceClaimRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["hash"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Hash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryGetAudienceClaimRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryGetAudienceClaimRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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(QueryGetAudienceClaimRequest { + hash: hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryGetAudienceClaimRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGetAudienceClaimResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.claim.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryGetAudienceClaimResponse", len)?; + if let Some(v) = self.claim.as_ref() { + struct_ser.serialize_field("claim", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGetAudienceClaimResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["claim"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Claim, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "claim" => Ok(GeneratedField::Claim), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryGetAudienceClaimResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryGetAudienceClaimResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut claim__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Claim => { + if claim__.is_some() { + return Err(serde::de::Error::duplicate_field("claim")); + } + claim__ = map_.next_value()?; + } + } + } + Ok(QueryGetAudienceClaimResponse { claim: claim__ }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryGetAudienceClaimResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGetAudienceRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.aud.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryGetAudienceRequest", len)?; + if !self.aud.is_empty() { + struct_ser.serialize_field("aud", &self.aud)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGetAudienceRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["aud"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Aud, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "aud" => Ok(GeneratedField::Aud), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryGetAudienceRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryGetAudienceRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut aud__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Aud => { + if aud__.is_some() { + return Err(serde::de::Error::duplicate_field("aud")); + } + aud__ = Some(map_.next_value()?); + } + } + } + Ok(QueryGetAudienceRequest { + aud: aud__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryGetAudienceRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryGetAudienceResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.audience.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryGetAudienceResponse", len)?; + if let Some(v) = self.audience.as_ref() { + struct_ser.serialize_field("audience", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryGetAudienceResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["audience"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Audience, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "audience" => Ok(GeneratedField::Audience), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryGetAudienceResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryGetAudienceResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut audience__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Audience => { + if audience__.is_some() { + return Err(serde::de::Error::duplicate_field("audience")); + } + audience__ = map_.next_value()?; + } + } + } + Ok(QueryGetAudienceResponse { + audience: audience__, + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryGetAudienceResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("xion.jwk.v1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest {}) + } + } + deserializer.deserialize_struct("xion.jwk.v1.QueryParamsRequest", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.jwk.v1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.jwk.v1.QueryParamsResponse", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidateJwtRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.aud.is_empty() { + len += 1; + } + if !self.sub.is_empty() { + len += 1; + } + if !self.sig_bytes.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryValidateJWTRequest", len)?; + if !self.aud.is_empty() { + struct_ser.serialize_field("aud", &self.aud)?; + } + if !self.sub.is_empty() { + struct_ser.serialize_field("sub", &self.sub)?; + } + if !self.sig_bytes.is_empty() { + struct_ser.serialize_field("sigBytes", &self.sig_bytes)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidateJwtRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["aud", "sub", "sigBytes"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Aud, + Sub, + SigBytes, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "aud" => Ok(GeneratedField::Aud), + "sub" => Ok(GeneratedField::Sub), + "sigBytes" => Ok(GeneratedField::SigBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidateJwtRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryValidateJWTRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut aud__ = None; + let mut sub__ = None; + let mut sig_bytes__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Aud => { + if aud__.is_some() { + return Err(serde::de::Error::duplicate_field("aud")); + } + aud__ = Some(map_.next_value()?); + } + GeneratedField::Sub => { + if sub__.is_some() { + return Err(serde::de::Error::duplicate_field("sub")); + } + sub__ = Some(map_.next_value()?); + } + GeneratedField::SigBytes => { + if sig_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("sigBytes")); + } + sig_bytes__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidateJwtRequest { + aud: aud__.unwrap_or_default(), + sub: sub__.unwrap_or_default(), + sig_bytes: sig_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryValidateJWTRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryValidateJwtResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.private_claims.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.jwk.v1.QueryValidateJWTResponse", len)?; + if !self.private_claims.is_empty() { + struct_ser.serialize_field("privateClaims", &self.private_claims)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryValidateJwtResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["privateClaims"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PrivateClaims, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "privateClaims" => Ok(GeneratedField::PrivateClaims), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryValidateJwtResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.jwk.v1.QueryValidateJWTResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut private_claims__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PrivateClaims => { + if private_claims__.is_some() { + return Err(serde::de::Error::duplicate_field("privateClaims")); + } + private_claims__ = Some(map_.next_value()?); + } + } + } + Ok(QueryValidateJwtResponse { + private_claims: private_claims__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.jwk.v1.QueryValidateJWTResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.tonic.rs b/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.tonic.rs new file mode 100644 index 00000000..da49c4db --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.jwk.v1.tonic.rs @@ -0,0 +1,1034 @@ +// @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("/xion.jwk.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn audience_claim( + &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("/xion.jwk.v1.Query/AudienceClaim"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Query", "AudienceClaim")); + self.inner.unary(req, path, codec).await + } + pub async fn audience( + &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("/xion.jwk.v1.Query/Audience"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Query", "Audience")); + self.inner.unary(req, path, codec).await + } + pub async fn audience_all( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/xion.jwk.v1.Query/AudienceAll"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Query", "AudienceAll")); + self.inner.unary(req, path, codec).await + } + pub async fn validate_jwt( + &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("/xion.jwk.v1.Query/ValidateJWT"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Query", "ValidateJWT")); + 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>; + async fn audience_claim( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn audience( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn audience_all( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn validate_jwt( + &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() { + "/xion.jwk.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) + } + "/xion.jwk.v1.Query/AudienceClaim" => { + #[allow(non_camel_case_types)] + struct AudienceClaimSvc(pub Arc); + impl tonic::server::UnaryService + for AudienceClaimSvc + { + type Response = super::QueryGetAudienceClaimResponse; + 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).audience_claim(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = AudienceClaimSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Query/Audience" => { + #[allow(non_camel_case_types)] + struct AudienceSvc(pub Arc); + impl tonic::server::UnaryService for AudienceSvc { + type Response = super::QueryGetAudienceResponse; + 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).audience(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = AudienceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Query/AudienceAll" => { + #[allow(non_camel_case_types)] + struct AudienceAllSvc(pub Arc); + impl tonic::server::UnaryService for AudienceAllSvc { + type Response = super::QueryAllAudienceResponse; + 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).audience_all(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = AudienceAllSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Query/ValidateJWT" => { + #[allow(non_camel_case_types)] + struct ValidateJWTSvc(pub Arc); + impl tonic::server::UnaryService for ValidateJWTSvc { + type Response = super::QueryValidateJwtResponse; + 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).validate_jwt(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = ValidateJWTSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "xion.jwk.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 create_audience_claim( + &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("/xion.jwk.v1.Msg/CreateAudienceClaim"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Msg", "CreateAudienceClaim")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_audience_claim( + &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("/xion.jwk.v1.Msg/DeleteAudienceClaim"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Msg", "DeleteAudienceClaim")); + self.inner.unary(req, path, codec).await + } + pub async fn create_audience( + &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("/xion.jwk.v1.Msg/CreateAudience"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Msg", "CreateAudience")); + self.inner.unary(req, path, codec).await + } + pub async fn update_audience( + &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("/xion.jwk.v1.Msg/UpdateAudience"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Msg", "UpdateAudience")); + self.inner.unary(req, path, codec).await + } + pub async fn delete_audience( + &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("/xion.jwk.v1.Msg/DeleteAudience"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.jwk.v1.Msg", "DeleteAudience")); + 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 create_audience_claim( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn delete_audience_claim( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn create_audience( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_audience( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn delete_audience( + &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() { + "/xion.jwk.v1.Msg/CreateAudienceClaim" => { + #[allow(non_camel_case_types)] + struct CreateAudienceClaimSvc(pub Arc); + impl tonic::server::UnaryService + for CreateAudienceClaimSvc + { + type Response = super::MsgCreateAudienceClaimResponse; + 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).create_audience_claim(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = CreateAudienceClaimSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Msg/DeleteAudienceClaim" => { + #[allow(non_camel_case_types)] + struct DeleteAudienceClaimSvc(pub Arc); + impl tonic::server::UnaryService + for DeleteAudienceClaimSvc + { + type Response = super::MsgDeleteAudienceClaimResponse; + 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).delete_audience_claim(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = DeleteAudienceClaimSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Msg/CreateAudience" => { + #[allow(non_camel_case_types)] + struct CreateAudienceSvc(pub Arc); + impl tonic::server::UnaryService for CreateAudienceSvc { + type Response = super::MsgCreateAudienceResponse; + 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).create_audience(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = CreateAudienceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Msg/UpdateAudience" => { + #[allow(non_camel_case_types)] + struct UpdateAudienceSvc(pub Arc); + impl tonic::server::UnaryService for UpdateAudienceSvc { + type Response = super::MsgUpdateAudienceResponse; + 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_audience(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = UpdateAudienceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.jwk.v1.Msg/DeleteAudience" => { + #[allow(non_camel_case_types)] + struct DeleteAudienceSvc(pub Arc); + impl tonic::server::UnaryService for DeleteAudienceSvc { + type Response = super::MsgDeleteAudienceResponse; + 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).delete_audience(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = DeleteAudienceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "xion.jwk.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.rs b/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.rs new file mode 100644 index 00000000..b9eaf7b5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.rs @@ -0,0 +1,131 @@ +// @generated +/// MintIncentiveTokens defines an event emitted on each block from the mint +/// module EndBlocker +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MintIncentiveTokens { + #[prost(string, tag = "1")] + pub bonded_ratio: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub inflation: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub annual_provisions: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + pub needed_amount: u64, + #[prost(uint64, tag = "5")] + pub collected_amount: u64, + #[prost(uint64, tag = "6")] + pub minted_amount: u64, + #[prost(uint64, tag = "7")] + pub burned_amount: u64, +} +/// Minter represents the minting state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Minter { + /// current annual inflation rate + #[prost(string, tag = "1")] + pub inflation: ::prost::alloc::string::String, + /// current annual expected provisions + #[prost(string, tag = "2")] + pub annual_provisions: ::prost::alloc::string::String, +} +/// Params defines the parameters for the x/mint module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// type of coin to mint + #[prost(string, tag = "1")] + pub mint_denom: ::prost::alloc::string::String, + /// maximum annual change in inflation rate + #[prost(string, tag = "2")] + pub inflation_rate_change: ::prost::alloc::string::String, + /// maximum inflation rate + #[prost(string, tag = "3")] + pub inflation_max: ::prost::alloc::string::String, + /// minimum inflation rate + #[prost(string, tag = "4")] + pub inflation_min: ::prost::alloc::string::String, + /// goal of percent bonded atoms + #[prost(string, tag = "5")] + pub goal_bonded: ::prost::alloc::string::String, + /// expected blocks per year + #[prost(uint64, tag = "6")] + pub blocks_per_year: u64, +} +/// GenesisState defines the mint module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// minter is a space for holding current inflation information. + #[prost(message, optional, tag = "1")] + pub minter: ::core::option::Option, + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::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, +} +/// QueryInflationRequest is the request type for the Query/Inflation RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryInflationRequest {} +/// QueryInflationResponse is the response type for the Query/Inflation RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryInflationResponse { + /// inflation is the current minting inflation value. + #[prost(bytes = "vec", tag = "1")] + pub inflation: ::prost::alloc::vec::Vec, +} +/// QueryAnnualProvisionsRequest is the request type for the +/// Query/AnnualProvisions RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAnnualProvisionsRequest {} +/// QueryAnnualProvisionsResponse is the response type for the +/// Query/AnnualProvisions RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAnnualProvisionsResponse { + /// annual_provisions is the current minting annual provisions value. + #[prost(bytes = "vec", tag = "1")] + pub annual_provisions: ::prost::alloc::vec::Vec, +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::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 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +include!("xion.mint.v1.serde.rs"); +include!("xion.mint.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.serde.rs b/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.serde.rs new file mode 100644 index 00000000..fedcbe66 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.serde.rs @@ -0,0 +1,1418 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.minter.is_some() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.mint.v1.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() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["minter", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Minter, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.mint.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MintIncentiveTokens { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.bonded_ratio.is_empty() { + len += 1; + } + if !self.inflation.is_empty() { + len += 1; + } + if !self.annual_provisions.is_empty() { + len += 1; + } + if self.needed_amount != 0 { + len += 1; + } + if self.collected_amount != 0 { + len += 1; + } + if self.minted_amount != 0 { + len += 1; + } + if self.burned_amount != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.mint.v1.MintIncentiveTokens", len)?; + if !self.bonded_ratio.is_empty() { + struct_ser.serialize_field("bondedRatio", &self.bonded_ratio)?; + } + if !self.inflation.is_empty() { + struct_ser.serialize_field("inflation", &self.inflation)?; + } + if !self.annual_provisions.is_empty() { + struct_ser.serialize_field("annualProvisions", &self.annual_provisions)?; + } + if self.needed_amount != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "neededAmount", + ToString::to_string(&self.needed_amount).as_str(), + )?; + } + if self.collected_amount != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "collectedAmount", + ToString::to_string(&self.collected_amount).as_str(), + )?; + } + if self.minted_amount != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "mintedAmount", + ToString::to_string(&self.minted_amount).as_str(), + )?; + } + if self.burned_amount != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "burnedAmount", + ToString::to_string(&self.burned_amount).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MintIncentiveTokens { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "bonded_ratio", + "bondedRatio", + "inflation", + "annual_provisions", + "annualProvisions", + "needed_amount", + "neededAmount", + "collected_amount", + "collectedAmount", + "minted_amount", + "mintedAmount", + "burned_amount", + "burnedAmount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BondedRatio, + Inflation, + AnnualProvisions, + NeededAmount, + CollectedAmount, + MintedAmount, + BurnedAmount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "bondedRatio" | "bonded_ratio" => Ok(GeneratedField::BondedRatio), + "inflation" => Ok(GeneratedField::Inflation), + "annualProvisions" | "annual_provisions" => { + Ok(GeneratedField::AnnualProvisions) + } + "neededAmount" | "needed_amount" => Ok(GeneratedField::NeededAmount), + "collectedAmount" | "collected_amount" => { + Ok(GeneratedField::CollectedAmount) + } + "mintedAmount" | "minted_amount" => Ok(GeneratedField::MintedAmount), + "burnedAmount" | "burned_amount" => Ok(GeneratedField::BurnedAmount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MintIncentiveTokens; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.MintIncentiveTokens") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut bonded_ratio__ = None; + let mut inflation__ = None; + let mut annual_provisions__ = None; + let mut needed_amount__ = None; + let mut collected_amount__ = None; + let mut minted_amount__ = None; + let mut burned_amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BondedRatio => { + if bonded_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field("bondedRatio")); + } + bonded_ratio__ = Some(map_.next_value()?); + } + 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()?); + } + GeneratedField::NeededAmount => { + if needed_amount__.is_some() { + return Err(serde::de::Error::duplicate_field("neededAmount")); + } + needed_amount__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::CollectedAmount => { + if collected_amount__.is_some() { + return Err(serde::de::Error::duplicate_field("collectedAmount")); + } + collected_amount__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::MintedAmount => { + if minted_amount__.is_some() { + return Err(serde::de::Error::duplicate_field("mintedAmount")); + } + minted_amount__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::BurnedAmount => { + if burned_amount__.is_some() { + return Err(serde::de::Error::duplicate_field("burnedAmount")); + } + burned_amount__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(MintIncentiveTokens { + bonded_ratio: bonded_ratio__.unwrap_or_default(), + inflation: inflation__.unwrap_or_default(), + annual_provisions: annual_provisions__.unwrap_or_default(), + needed_amount: needed_amount__.unwrap_or_default(), + collected_amount: collected_amount__.unwrap_or_default(), + minted_amount: minted_amount__.unwrap_or_default(), + burned_amount: burned_amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.mint.v1.MintIncentiveTokens", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Minter { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.inflation.is_empty() { + len += 1; + } + if !self.annual_provisions.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.mint.v1.Minter", len)?; + if !self.inflation.is_empty() { + struct_ser.serialize_field("inflation", &self.inflation)?; + } + if !self.annual_provisions.is_empty() { + struct_ser.serialize_field("annualProvisions", &self.annual_provisions)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Minter { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["inflation", "annual_provisions", "annualProvisions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inflation, + AnnualProvisions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.Minter") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.mint.v1.Minter", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.mint.v1.MsgUpdateParams", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.mint.v1.MsgUpdateParams", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.mint.v1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.MsgUpdateParamsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "xion.mint.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.mint_denom.is_empty() { + len += 1; + } + if !self.inflation_rate_change.is_empty() { + len += 1; + } + if !self.inflation_max.is_empty() { + len += 1; + } + if !self.inflation_min.is_empty() { + len += 1; + } + if !self.goal_bonded.is_empty() { + len += 1; + } + if self.blocks_per_year != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.mint.v1.Params", len)?; + if !self.mint_denom.is_empty() { + struct_ser.serialize_field("mintDenom", &self.mint_denom)?; + } + if !self.inflation_rate_change.is_empty() { + struct_ser.serialize_field("inflationRateChange", &self.inflation_rate_change)?; + } + if !self.inflation_max.is_empty() { + struct_ser.serialize_field("inflationMax", &self.inflation_max)?; + } + if !self.inflation_min.is_empty() { + struct_ser.serialize_field("inflationMin", &self.inflation_min)?; + } + if !self.goal_bonded.is_empty() { + struct_ser.serialize_field("goalBonded", &self.goal_bonded)?; + } + if self.blocks_per_year != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blocksPerYear", + ToString::to_string(&self.blocks_per_year).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.Params") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.mint.v1.Params", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAnnualProvisionsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.mint.v1.QueryAnnualProvisionsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.QueryAnnualProvisionsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryAnnualProvisionsRequest {}) + } + } + deserializer.deserialize_struct( + "xion.mint.v1.QueryAnnualProvisionsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAnnualProvisionsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.annual_provisions.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.mint.v1.QueryAnnualProvisionsResponse", len)?; + if !self.annual_provisions.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "annualProvisions", + pbjson::private::base64::encode(&self.annual_provisions).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAnnualProvisionsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["annual_provisions", "annualProvisions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AnnualProvisions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.QueryAnnualProvisionsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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( + "xion.mint.v1.QueryAnnualProvisionsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryInflationRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("xion.mint.v1.QueryInflationRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryInflationRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.QueryInflationRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryInflationRequest {}) + } + } + deserializer.deserialize_struct( + "xion.mint.v1.QueryInflationRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryInflationResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.inflation.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.mint.v1.QueryInflationResponse", len)?; + if !self.inflation.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "inflation", + pbjson::private::base64::encode(&self.inflation).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryInflationResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["inflation"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inflation, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.QueryInflationResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::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( + "xion.mint.v1.QueryInflationResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("xion.mint.v1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest {}) + } + } + deserializer.deserialize_struct("xion.mint.v1.QueryParamsRequest", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.mint.v1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.mint.v1.QueryParamsResponse") + } + + fn visit_map(self, mut map_: V) -> std::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( + "xion.mint.v1.QueryParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.tonic.rs b/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.tonic.rs new file mode 100644 index 00000000..1bba730e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.mint.v1.tonic.rs @@ -0,0 +1,660 @@ +// @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("/xion.mint.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.mint.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + pub async fn inflation( + &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("/xion.mint.v1.Query/Inflation"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.mint.v1.Query", "Inflation")); + self.inner.unary(req, path, codec).await + } + pub async fn annual_provisions( + &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("/xion.mint.v1.Query/AnnualProvisions"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.mint.v1.Query", "AnnualProvisions")); + 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>; + async fn inflation( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn annual_provisions( + &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() { + "/xion.mint.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) + } + "/xion.mint.v1.Query/Inflation" => { + #[allow(non_camel_case_types)] + struct InflationSvc(pub Arc); + impl tonic::server::UnaryService for InflationSvc { + type Response = super::QueryInflationResponse; + 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).inflation(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = InflationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.mint.v1.Query/AnnualProvisions" => { + #[allow(non_camel_case_types)] + struct AnnualProvisionsSvc(pub Arc); + impl tonic::server::UnaryService + for AnnualProvisionsSvc + { + type Response = super::QueryAnnualProvisionsResponse; + 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).annual_provisions(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = AnnualProvisionsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "xion.mint.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("/xion.mint.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.mint.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() { + "/xion.mint.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 = "xion.mint.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.v1.rs b/cosmos-sdk-proto/src/prost/xion/xion.v1.rs new file mode 100644 index 00000000..dc7839c4 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.v1.rs @@ -0,0 +1,115 @@ +// @generated +/// AuthzAllowance creates allowance only authz message for a specific grantee +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthzAllowance { + /// allowance can be any of basic and periodic fee allowance. + #[prost(message, optional, tag = "1")] + pub allowance: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + #[prost(string, tag = "2")] + pub authz_grantee: ::prost::alloc::string::String, +} +/// ContractsAllowance creates allowance only for specific contracts +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ContractsAllowance { + /// allowance can be any allowance interface type. + #[prost(message, optional, tag = "1")] + pub allowance: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + #[prost(string, repeated, tag = "2")] + pub contract_addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MultiAnyAllowance creates an allowance that pays if any of the internal allowances are met +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MultiAnyAllowance { + /// allowance can be any allowance interface type. + #[prost(message, repeated, tag = "1")] + pub allowances: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(uint32, tag = "1")] + pub platform_percentage: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryWebAuthNVerifyRegisterRequest { + #[prost(string, tag = "1")] + pub addr: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub challenge: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub rp: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "4")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryWebAuthNVerifyRegisterResponse { + #[prost(bytes = "vec", tag = "1")] + pub credential: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryWebAuthNVerifyAuthenticateRequest { + #[prost(string, tag = "1")] + pub addr: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub challenge: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub rp: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "4")] + pub credential: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + pub data: ::prost::alloc::vec::Vec, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryWebAuthNVerifyAuthenticateResponse {} +/// MsgSend represents a message to send coins from one account to another. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSend { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgSendResponse defines the Msg/Send response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSendResponse {} +/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiSend { + /// Inputs, despite being `repeated`, only allows one sender input. This is + /// checked in MsgMultiSend's ValidateBasic. + #[prost(message, repeated, tag = "1")] + pub inputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub outputs: ::prost::alloc::vec::Vec, +} +/// MsgMultiSendResponse defines the Msg/MultiSend response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiSendResponse {} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetPlatformPercentage { + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// platform_percentage is the platform fee percentage to multiplied by 10000 + #[prost(uint32, tag = "2")] + pub platform_percentage: u32, +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetPlatformPercentageResponse {} +include!("xion.v1.serde.rs"); +include!("xion.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/xion/xion.v1.serde.rs b/cosmos-sdk-proto/src/prost/xion/xion.v1.serde.rs new file mode 100644 index 00000000..f528ec9c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.v1.serde.rs @@ -0,0 +1,1552 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AuthzAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.allowance.is_some() { + len += 1; + } + if !self.authz_grantee.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.v1.AuthzAllowance", len)?; + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + if !self.authz_grantee.is_empty() { + struct_ser.serialize_field("authzGrantee", &self.authz_grantee)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AuthzAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowance", "authz_grantee", "authzGrantee"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowance, + AuthzGrantee, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "allowance" => Ok(GeneratedField::Allowance), + "authzGrantee" | "authz_grantee" => Ok(GeneratedField::AuthzGrantee), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AuthzAllowance; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.AuthzAllowance") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowance__ = None; + let mut authz_grantee__ = 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::AuthzGrantee => { + if authz_grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("authzGrantee")); + } + authz_grantee__ = Some(map_.next_value()?); + } + } + } + Ok(AuthzAllowance { + allowance: allowance__, + authz_grantee: authz_grantee__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.v1.AuthzAllowance", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ContractsAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.allowance.is_some() { + len += 1; + } + if !self.contract_addresses.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.v1.ContractsAllowance", len)?; + if let Some(v) = self.allowance.as_ref() { + struct_ser.serialize_field("allowance", v)?; + } + if !self.contract_addresses.is_empty() { + struct_ser.serialize_field("contractAddresses", &self.contract_addresses)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ContractsAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowance", "contract_addresses", "contractAddresses"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowance, + ContractAddresses, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "allowance" => Ok(GeneratedField::Allowance), + "contractAddresses" | "contract_addresses" => { + Ok(GeneratedField::ContractAddresses) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ContractsAllowance; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.ContractsAllowance") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowance__ = None; + let mut contract_addresses__ = 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::ContractAddresses => { + if contract_addresses__.is_some() { + return Err(serde::de::Error::duplicate_field("contractAddresses")); + } + contract_addresses__ = Some(map_.next_value()?); + } + } + } + Ok(ContractsAllowance { + allowance: allowance__, + contract_addresses: contract_addresses__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.v1.ContractsAllowance", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.platform_percentage != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.v1.GenesisState", len)?; + if self.platform_percentage != 0 { + struct_ser.serialize_field("platformPercentage", &self.platform_percentage)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["platform_percentage", "platformPercentage"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PlatformPercentage, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "platformPercentage" | "platform_percentage" => { + Ok(GeneratedField::PlatformPercentage) + } + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut platform_percentage__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PlatformPercentage => { + if platform_percentage__.is_some() { + return Err(serde::de::Error::duplicate_field( + "platformPercentage", + )); + } + platform_percentage__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(GenesisState { + platform_percentage: platform_percentage__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMultiSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.inputs.is_empty() { + len += 1; + } + if !self.outputs.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.v1.MsgMultiSend", len)?; + if !self.inputs.is_empty() { + struct_ser.serialize_field("inputs", &self.inputs)?; + } + if !self.outputs.is_empty() { + struct_ser.serialize_field("outputs", &self.outputs)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMultiSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["inputs", "outputs"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Inputs, + Outputs, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MsgMultiSend") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.v1.MsgMultiSend", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgMultiSendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("xion.v1.MsgMultiSendResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgMultiSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MsgMultiSendResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgMultiSendResponse {}) + } + } + deserializer.deserialize_struct("xion.v1.MsgMultiSendResponse", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.from_address.is_empty() { + len += 1; + } + if !self.to_address.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.v1.MsgSend", len)?; + if !self.from_address.is_empty() { + struct_ser.serialize_field("fromAddress", &self.from_address)?; + } + if !self.to_address.is_empty() { + struct_ser.serialize_field("toAddress", &self.to_address)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MsgSend") + } + + fn visit_map(self, mut map_: V) -> std::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("xion.v1.MsgSend", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("xion.v1.MsgSendResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MsgSendResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgSendResponse {}) + } + } + deserializer.deserialize_struct("xion.v1.MsgSendResponse", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSetPlatformPercentage { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if self.platform_percentage != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.v1.MsgSetPlatformPercentage", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if self.platform_percentage != 0 { + struct_ser.serialize_field("platformPercentage", &self.platform_percentage)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSetPlatformPercentage { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "platform_percentage", "platformPercentage"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + PlatformPercentage, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "platformPercentage" | "platform_percentage" => { + Ok(GeneratedField::PlatformPercentage) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSetPlatformPercentage; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MsgSetPlatformPercentage") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut platform_percentage__ = 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::PlatformPercentage => { + if platform_percentage__.is_some() { + return Err(serde::de::Error::duplicate_field( + "platformPercentage", + )); + } + platform_percentage__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(MsgSetPlatformPercentage { + authority: authority__.unwrap_or_default(), + platform_percentage: platform_percentage__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.v1.MsgSetPlatformPercentage", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgSetPlatformPercentageResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.v1.MsgSetPlatformPercentageResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgSetPlatformPercentageResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgSetPlatformPercentageResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MsgSetPlatformPercentageResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgSetPlatformPercentageResponse {}) + } + } + deserializer.deserialize_struct( + "xion.v1.MsgSetPlatformPercentageResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MultiAnyAllowance { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.allowances.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("xion.v1.MultiAnyAllowance", len)?; + if !self.allowances.is_empty() { + struct_ser.serialize_field("allowances", &self.allowances)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MultiAnyAllowance { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowances"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Allowances, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = MultiAnyAllowance; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.MultiAnyAllowance") + } + + fn visit_map(self, mut map_: V) -> std::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(MultiAnyAllowance { + allowances: allowances__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("xion.v1.MultiAnyAllowance", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryWebAuthNVerifyAuthenticateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.addr.is_empty() { + len += 1; + } + if !self.challenge.is_empty() { + len += 1; + } + if !self.rp.is_empty() { + len += 1; + } + if !self.credential.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.v1.QueryWebAuthNVerifyAuthenticateRequest", len)?; + if !self.addr.is_empty() { + struct_ser.serialize_field("addr", &self.addr)?; + } + if !self.challenge.is_empty() { + struct_ser.serialize_field("challenge", &self.challenge)?; + } + if !self.rp.is_empty() { + struct_ser.serialize_field("rp", &self.rp)?; + } + if !self.credential.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "credential", + pbjson::private::base64::encode(&self.credential).as_str(), + )?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryWebAuthNVerifyAuthenticateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["addr", "challenge", "rp", "credential", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Addr, + Challenge, + Rp, + Credential, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "addr" => Ok(GeneratedField::Addr), + "challenge" => Ok(GeneratedField::Challenge), + "rp" => Ok(GeneratedField::Rp), + "credential" => Ok(GeneratedField::Credential), + "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 = QueryWebAuthNVerifyAuthenticateRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.QueryWebAuthNVerifyAuthenticateRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut addr__ = None; + let mut challenge__ = None; + let mut rp__ = None; + let mut credential__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Addr => { + if addr__.is_some() { + return Err(serde::de::Error::duplicate_field("addr")); + } + addr__ = Some(map_.next_value()?); + } + GeneratedField::Challenge => { + if challenge__.is_some() { + return Err(serde::de::Error::duplicate_field("challenge")); + } + challenge__ = Some(map_.next_value()?); + } + GeneratedField::Rp => { + if rp__.is_some() { + return Err(serde::de::Error::duplicate_field("rp")); + } + rp__ = Some(map_.next_value()?); + } + GeneratedField::Credential => { + if credential__.is_some() { + return Err(serde::de::Error::duplicate_field("credential")); + } + credential__ = 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(QueryWebAuthNVerifyAuthenticateRequest { + addr: addr__.unwrap_or_default(), + challenge: challenge__.unwrap_or_default(), + rp: rp__.unwrap_or_default(), + credential: credential__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.v1.QueryWebAuthNVerifyAuthenticateRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryWebAuthNVerifyAuthenticateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("xion.v1.QueryWebAuthNVerifyAuthenticateResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryWebAuthNVerifyAuthenticateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryWebAuthNVerifyAuthenticateResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.QueryWebAuthNVerifyAuthenticateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryWebAuthNVerifyAuthenticateResponse {}) + } + } + deserializer.deserialize_struct( + "xion.v1.QueryWebAuthNVerifyAuthenticateResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryWebAuthNVerifyRegisterRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.addr.is_empty() { + len += 1; + } + if !self.challenge.is_empty() { + len += 1; + } + if !self.rp.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.v1.QueryWebAuthNVerifyRegisterRequest", len)?; + if !self.addr.is_empty() { + struct_ser.serialize_field("addr", &self.addr)?; + } + if !self.challenge.is_empty() { + struct_ser.serialize_field("challenge", &self.challenge)?; + } + if !self.rp.is_empty() { + struct_ser.serialize_field("rp", &self.rp)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryWebAuthNVerifyRegisterRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["addr", "challenge", "rp", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Addr, + Challenge, + Rp, + Data, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "addr" => Ok(GeneratedField::Addr), + "challenge" => Ok(GeneratedField::Challenge), + "rp" => Ok(GeneratedField::Rp), + "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 = QueryWebAuthNVerifyRegisterRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.QueryWebAuthNVerifyRegisterRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut addr__ = None; + let mut challenge__ = None; + let mut rp__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Addr => { + if addr__.is_some() { + return Err(serde::de::Error::duplicate_field("addr")); + } + addr__ = Some(map_.next_value()?); + } + GeneratedField::Challenge => { + if challenge__.is_some() { + return Err(serde::de::Error::duplicate_field("challenge")); + } + challenge__ = Some(map_.next_value()?); + } + GeneratedField::Rp => { + if rp__.is_some() { + return Err(serde::de::Error::duplicate_field("rp")); + } + rp__ = 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(QueryWebAuthNVerifyRegisterRequest { + addr: addr__.unwrap_or_default(), + challenge: challenge__.unwrap_or_default(), + rp: rp__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.v1.QueryWebAuthNVerifyRegisterRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryWebAuthNVerifyRegisterResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.credential.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("xion.v1.QueryWebAuthNVerifyRegisterResponse", len)?; + if !self.credential.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "credential", + pbjson::private::base64::encode(&self.credential).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryWebAuthNVerifyRegisterResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["credential"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Credential, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "credential" => Ok(GeneratedField::Credential), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryWebAuthNVerifyRegisterResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct xion.v1.QueryWebAuthNVerifyRegisterResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut credential__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Credential => { + if credential__.is_some() { + return Err(serde::de::Error::duplicate_field("credential")); + } + credential__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(QueryWebAuthNVerifyRegisterResponse { + credential: credential__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "xion.v1.QueryWebAuthNVerifyRegisterResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/xion/xion.v1.tonic.rs b/cosmos-sdk-proto/src/prost/xion/xion.v1.tonic.rs new file mode 100644 index 00000000..3b1b19df --- /dev/null +++ b/cosmos-sdk-proto/src/prost/xion/xion.v1.tonic.rs @@ -0,0 +1,748 @@ +// @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 web_auth_n_verify_register( + &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("/xion.v1.Query/WebAuthNVerifyRegister"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.v1.Query", "WebAuthNVerifyRegister")); + self.inner.unary(req, path, codec).await + } + pub async fn web_auth_n_verify_authenticate( + &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("/xion.v1.Query/WebAuthNVerifyAuthenticate"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "xion.v1.Query", + "WebAuthNVerifyAuthenticate", + )); + 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 web_auth_n_verify_register( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn web_auth_n_verify_authenticate( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + 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() { + "/xion.v1.Query/WebAuthNVerifyRegister" => { + #[allow(non_camel_case_types)] + struct WebAuthNVerifyRegisterSvc(pub Arc); + impl + tonic::server::UnaryService + for WebAuthNVerifyRegisterSvc + { + type Response = super::QueryWebAuthNVerifyRegisterResponse; + 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).web_auth_n_verify_register(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = WebAuthNVerifyRegisterSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.v1.Query/WebAuthNVerifyAuthenticate" => { + #[allow(non_camel_case_types)] + struct WebAuthNVerifyAuthenticateSvc(pub Arc); + impl + tonic::server::UnaryService + for WebAuthNVerifyAuthenticateSvc + { + type Response = super::QueryWebAuthNVerifyAuthenticateResponse; + 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).web_auth_n_verify_authenticate(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = WebAuthNVerifyAuthenticateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "xion.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 send( + &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("/xion.v1.Msg/Send"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.v1.Msg", "Send")); + self.inner.unary(req, path, codec).await + } + pub async fn multi_send( + &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("/xion.v1.Msg/MultiSend"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.v1.Msg", "MultiSend")); + self.inner.unary(req, path, codec).await + } + pub async fn set_platform_percentage( + &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("/xion.v1.Msg/SetPlatformPercentage"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("xion.v1.Msg", "SetPlatformPercentage")); + 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 send( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn multi_send( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn set_platform_percentage( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + 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() { + "/xion.v1.Msg/Send" => { + #[allow(non_camel_case_types)] + struct SendSvc(pub Arc); + impl tonic::server::UnaryService for SendSvc { + type Response = super::MsgSendResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).send(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = SendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.v1.Msg/MultiSend" => { + #[allow(non_camel_case_types)] + struct MultiSendSvc(pub Arc); + impl tonic::server::UnaryService for MultiSendSvc { + type Response = super::MsgMultiSendResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).multi_send(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = MultiSendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/xion.v1.Msg/SetPlatformPercentage" => { + #[allow(non_camel_case_types)] + struct SetPlatformPercentageSvc(pub Arc); + impl tonic::server::UnaryService + for SetPlatformPercentageSvc + { + type Response = super::MsgSetPlatformPercentageResponse; + 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_platform_percentage(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.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 = SetPlatformPercentageSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_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 = "xion.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/traits.rs b/cosmos-sdk-proto/src/traits.rs index 1484fa50..a9ac8722 100644 --- a/cosmos-sdk-proto/src/traits.rs +++ b/cosmos-sdk-proto/src/traits.rs @@ -2,8 +2,9 @@ pub use prost::{Message, Name}; +use alloc::{string::String, vec::Vec}; +use core::str::FromStr; use prost::EncodeError; -use std::str::FromStr; /// Extension trait for [`Message`]. pub trait MessageExt: Message { diff --git a/cosmos-sdk-proto/src/type_names.rs b/cosmos-sdk-proto/src/type_names.rs index e555f162..40826412 100644 --- a/cosmos-sdk-proto/src/type_names.rs +++ b/cosmos-sdk-proto/src/type_names.rs @@ -300,6 +300,11 @@ impl_name!( "cosmos.staking.v1beta1", "Validator" ); +impl_name!( + cosmos::staking::v1beta1::StakeAuthorization, + "cosmos.staking.v1beta1", + "StakeAuthorization" +); impl_name!( cosmos::base::abci::v1beta1::MsgData, @@ -333,6 +338,21 @@ impl_name!( "cosmos.authz.v1beta1", "MsgExec" ); +impl_name!( + cosmos::authz::v1beta1::GenericAuthorization, + "cosmos.authz.v1beta1", + "GenericAuthorization" +); +impl_name!( + cosmos::authz::v1beta1::GrantAuthorization, + "cosmos.authz.v1beta1", + "GrantAuthorization" +); +impl_name!( + cosmos::authz::v1beta1::Grant, + "cosmos.authz.v1beta1", + "Grant" +); impl_name!(cosmos::tx::v1beta1::Tx, "cosmos.tx.v1beta1", "Tx"); impl_name!( @@ -485,3 +505,21 @@ mod wasm { "MsgClearAdminResponse" ); } + +#[cfg(feature = "xion")] +mod xion { + use crate::{xion, traits::Name}; + + const XION_PACKAGE: &str = "xion.v1"; + + impl_name!( + xion::v1::AuthzAllowance, + XION_PACKAGE, + "AuthzAllowance" + ); + impl_name!( + xion::v1::ContractsAllowance, + XION_PACKAGE, + "ContractsAllowance" + ); +} \ No newline at end of file diff --git a/cosmrs/.idea/workspace.xml b/cosmrs/.idea/workspace.xml new file mode 100644 index 00000000..5f0fccb3 --- /dev/null +++ b/cosmrs/.idea/workspace.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + { + "associatedIndex": 7 +} + + + + { + "keyToString": { + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.rust.reset.selective.auto.import": "true", + "last_opened_file_path": "/Users/jedrzej/workspace/cosmos-rust-fork/cosmos-rust/cosmrs", + "node.js.detected.package.eslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "org.rust.cargo.project.model.PROJECT_DISCOVERY": "true", + "org.rust.cargo.project.model.impl.CargoExternalSystemProjectAware.subscribe.first.balloon": "", + "org.rust.first.attach.projects": "true", + "settings.editor.selected.configurable": "language.rust.cargo.check" + } +} + + + + + + + + + 1718192228740 + + + + + + \ No newline at end of file diff --git a/cosmrs/CHANGELOG.md b/cosmrs/CHANGELOG.md index 30f75617..ac03efd2 100644 --- a/cosmrs/CHANGELOG.md +++ b/cosmrs/CHANGELOG.md @@ -4,6 +4,34 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.18.0 (2024-08-02) +### Added +- Support `Coin` with amount `0` and empty denom ([#479]) +- Impl `Default` for `Coin` and `Denom` ([#479]) + +### Changed +- Bump tendermint-rs dependencies to v0.38 ([#476]) +- Bump `cosmos-sdk-proto` to 0.23 ([#480]) + +[#476]: https://github.com/cosmos/cosmos-rust/pull/476 +[#479]: https://github.com/cosmos/cosmos-rust/pull/479 +[#480]: https://github.com/cosmos/cosmos-rust/pull/480 + +## 0.17.0 (2024-06-27) +### Added +- Basic parsing of `msg_responses` field inside `TxMsgData` ([#472]) + +### Changed +- Bump tendermint-rs dependencies to v0.37 ([#469]) +- Match upstream Cosmos SDK's `Denom` validation logic ([#468], [#470]) +- Bump `cosmos-sdk-proto` to v0.22 ([#473]) + +[#468]: https://github.com/cosmos/cosmos-rust/pull/468 +[#469]: https://github.com/cosmos/cosmos-rust/pull/469 +[#470]: https://github.com/cosmos/cosmos-rust/pull/470 +[#472]: https://github.com/cosmos/cosmos-rust/pull/472 +[#473]: https://github.com/cosmos/cosmos-rust/pull/473 + ## 0.16.0 (2024-03-15) ### Added - Support for uppercase Bech32 ([#444]) diff --git a/cosmrs/Cargo.toml b/cosmrs/Cargo.toml index 6bbd103c..fb399e97 100644 --- a/cosmrs/Cargo.toml +++ b/cosmrs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cosmrs" -version = "0.17.0-pre" +version = "0.19.0-pre" authors = ["Tony Arcieri "] license = "Apache-2.0" repository = "https://github.com/cosmos/cosmos-rust/tree/main/cosmrs" @@ -12,7 +12,7 @@ edition = "2021" rust-version = "1.72" [dependencies] -cosmos-sdk-proto = { version = "=0.22.0-pre", default-features = false, path = "../cosmos-sdk-proto" } +cosmos-sdk-proto = { version = "=0.24.0-pre", default-features = false, features = ["std"], path = "../cosmos-sdk-proto" } ecdsa = "0.16" eyre = "0.6" k256 = { version = "0.13", default-features = false, features = ["ecdsa", "sha256"] } @@ -21,12 +21,12 @@ serde = { version = "1", features = ["serde_derive"] } serde_json = "1" signature = { version = "2", features = ["std"] } subtle-encoding = { version = "0.5", features = ["bech32-preview"] } -tendermint = { version = "0.37", features = ["secp256k1"] } +tendermint = { version = "0.39.1", features = ["secp256k1"] } thiserror = "1" # optional dependencies bip32 = { version = "0.5", optional = true, default-features = false, features = ["alloc", "secp256k1"] } -tendermint-rpc = { version = "0.37", optional = true, features = ["http-client"] } +tendermint-rpc = { version = "0.39.1", optional = true, features = ["http-client"] } tokio = { version = "1", optional = true } [dev-dependencies] diff --git a/cosmrs/src/abci.rs b/cosmrs/src/abci.rs index c26daa32..6fad5b75 100644 --- a/cosmrs/src/abci.rs +++ b/cosmrs/src/abci.rs @@ -5,7 +5,7 @@ mod msg_data; pub use self::{ gas_info::GasInfo, - msg_data::{MsgData, TxMsgData}, + msg_data::{MsgData, MsgResponse, TxMsgData}, }; /// Transaction data. diff --git a/cosmrs/src/abci/msg_data.rs b/cosmrs/src/abci/msg_data.rs index 22706546..17f4f1a2 100644 --- a/cosmrs/src/abci/msg_data.rs +++ b/cosmrs/src/abci/msg_data.rs @@ -1,13 +1,14 @@ use super::Data; use crate::{ - proto::{self, traits::Message}, + proto::{self, traits::Message, Any}, tx::Msg, ErrorReport, Result, }; use eyre::eyre; +use serde::{Deserialize, Serialize}; /// MsgData defines the data returned in a Result object during message execution. -#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] pub struct MsgData { /// Incoming message type that emitted this result data, for example `"/cosmos.bank.v1beta1.MsgSend"`. pub msg_type: String, @@ -50,13 +51,52 @@ impl From for proto::cosmos::base::abci::v1beta1::MsgData { } } +/// The messages responses of the TxMsgData. Corresponds to `Any` +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] +pub struct MsgResponse { + /// Response message type that emitted this result data, for example `"/cosmwasm.wasm.v1.MsgExecuteContractResponse"`. + pub type_url: String, + + /// Binary data emitted by this response. + pub value: Vec, +} + +impl MsgResponse { + /// Attempts to decode the `data` field of this result into the specified `Msg` type. + pub fn try_decode_as(&self) -> Result { + M::Proto::decode(&*self.value)?.try_into() + } +} + +impl From for MsgResponse { + fn from(any: Any) -> Self { + MsgResponse { + type_url: any.type_url, + value: any.value, + } + } +} + +impl From for Any { + fn from(msg_response: MsgResponse) -> Self { + Any { + type_url: msg_response.type_url, + value: msg_response.value, + } + } +} + /// TxMsgData defines a list of MsgData. A transaction will have a MsgData object for each message. -#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] pub struct TxMsgData { /// Data emitted by the messages in a particular transaction. // Note: this field will be deprecated and not populated as of cosmos-sdk 0.46. // It will be superseded by `msg_responses` field of type Vec pub data: Vec, + + /// This field contains the Msg handler responses packed into Anys. + // Note: this field is an empty vec for chains running cosmos-sdk < 0.46. + pub msg_responses: Vec, } impl TryFrom for TxMsgData { @@ -76,9 +116,11 @@ impl TryFrom for TxMsgData { #[allow(deprecated)] fn try_from(proto: proto::cosmos::base::abci::v1beta1::TxMsgData) -> Result { - // TODO(tarcieri): parse `msg_responses` - if !proto.msg_responses.is_empty() { - return Err(eyre!("TxMsgData::msg_responses unsupported")); + // this case should be impossible as with the switch in cosmos-sdk 0.46 only one of those should contain any data + if !proto.msg_responses.is_empty() && !proto.data.is_empty() { + return Err(eyre!( + "TxMsgData: both msg_responses and data fields are populated" + )); } Ok(TxMsgData { @@ -87,6 +129,7 @@ impl TryFrom for TxMsgData { .into_iter() .map(TryFrom::try_from) .collect::>()?, + msg_responses: proto.msg_responses.into_iter().map(Into::into).collect(), }) } } @@ -96,7 +139,11 @@ impl From for proto::cosmos::base::abci::v1beta1::TxMsgData { fn from(tx_msg_data: TxMsgData) -> Self { proto::cosmos::base::abci::v1beta1::TxMsgData { data: tx_msg_data.data.into_iter().map(Into::into).collect(), - msg_responses: vec![], // TODO(tarcieri): serialize responses + msg_responses: tx_msg_data + .msg_responses + .into_iter() + .map(Into::into) + .collect(), } } } diff --git a/cosmrs/src/base/coin.rs b/cosmrs/src/base/coin.rs index fe6e6e52..a524e0fb 100644 --- a/cosmrs/src/base/coin.rs +++ b/cosmrs/src/base/coin.rs @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; /// Coin defines a token with a denomination and an amount. -#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize)] pub struct Coin { /// Denomination pub denom: Denom, @@ -35,10 +35,15 @@ impl TryFrom<&proto::cosmos::base::v1beta1::Coin> for Coin { type Error = ErrorReport; fn try_from(proto: &proto::cosmos::base::v1beta1::Coin) -> Result { - Ok(Coin { - denom: proto.denom.parse()?, - amount: proto.amount.parse()?, - }) + // Support an empty denom when the amount is `0`. See cosmos/cosmos-rust#477 + if proto.denom.is_empty() && proto.amount == "0" { + Ok(Coin::default()) + } else { + Ok(Coin { + denom: proto.denom.parse()?, + amount: proto.amount.parse()?, + }) + } } } @@ -67,9 +72,20 @@ impl fmt::Display for Coin { #[cfg(test)] mod tests { use super::Coin; + use crate::proto; #[test] fn new() { Coin::new(1000, "uatom").unwrap(); } + + #[test] + fn zero_value_coin_with_empty_denom() { + let zero_proto = proto::cosmos::base::v1beta1::Coin::from(Coin::default()); + assert_eq!(&zero_proto.denom, ""); + assert_eq!(&zero_proto.amount, "0"); + + let zero_coin = Coin::try_from(zero_proto).unwrap(); + assert_eq!(zero_coin, Coin::default()) + } } diff --git a/cosmrs/src/base/denom.rs b/cosmrs/src/base/denom.rs index a5c13dc5..d432da2b 100644 --- a/cosmrs/src/base/denom.rs +++ b/cosmrs/src/base/denom.rs @@ -3,7 +3,7 @@ use serde::{de, de::Error as _, ser, Deserialize, Serialize}; use std::{fmt, str::FromStr}; /// Denomination. -#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Ord)] pub struct Denom(String); impl Denom { diff --git a/cosmrs/src/feegrant/basic_allowance.rs b/cosmrs/src/feegrant/basic_allowance.rs index 30cf5f9c..00b9c108 100644 --- a/cosmrs/src/feegrant/basic_allowance.rs +++ b/cosmrs/src/feegrant/basic_allowance.rs @@ -38,11 +38,7 @@ impl TryFrom<&proto::cosmos::feegrant::v1beta1::BasicAllowance> for BasicAllowan .iter() .map(TryFrom::try_from) .collect::>()?, - expiration: proto - .expiration - .clone() - .map(TryFrom::try_from) - .transpose()?, + expiration: proto.expiration.map(TryFrom::try_from).transpose()?, }) } } diff --git a/proto-build/Cargo.toml b/proto-build/Cargo.toml index a043287b..79013376 100644 --- a/proto-build/Cargo.toml +++ b/proto-build/Cargo.toml @@ -6,9 +6,9 @@ edition = "2018" publish = false [dependencies] -prost = "0.12" -prost-build = "0.12.3" -tonic = "0.11" -tonic-build = "0.11" +prost = "0.13" +prost-build = "0.13" +tonic = "0.12" +tonic-build = "0.12" regex = "1" walkdir = "2" diff --git a/proto-build/buf.sdk.gen.yaml b/proto-build/buf.sdk.gen.yaml index 3565fdcc..12f7ef23 100644 --- a/proto-build/buf.sdk.gen.yaml +++ b/proto-build/buf.sdk.gen.yaml @@ -1,10 +1,16 @@ version: v1 plugins: - - plugin: buf.build/community/neoeinstein-prost:v0.2.1 + - plugin: buf.build/community/neoeinstein-prost:v0.3.1 out: . opt: + - compile_well_known_types + - extern_path=.google.protobuf=::tendermint_proto::google::protobuf - extern_path=.tendermint=::tendermint_proto::v0_34 + - plugin: buf.build/community/neoeinstein-prost-serde:v0.3.0 + out: . - plugin: buf.build/community/neoeinstein-tonic:v0.3.0 out: . opt: + - compile_well_known_types + - extern_path=.google.protobuf=::tendermint_proto::google::protobuf - extern_path=.tendermint=::tendermint_proto::v0_34 diff --git a/proto-build/buf.wasmd.gen.yaml b/proto-build/buf.wasmd.gen.yaml index 17b5bb6e..1618dd1e 100644 --- a/proto-build/buf.wasmd.gen.yaml +++ b/proto-build/buf.wasmd.gen.yaml @@ -1,8 +1,16 @@ version: v1 plugins: - - plugin: buf.build/community/neoeinstein-prost:v0.2.1 + - plugin: buf.build/community/neoeinstein-prost:v0.3.1 + out: . + opt: + - compile_well_known_types + - extern_path=.google.protobuf=::tendermint_proto::google::protobuf + - extern_path=.tendermint=::tendermint_proto::v0_34 + - plugin: buf.build/community/neoeinstein-prost-serde:v0.3.0 out: . - plugin: buf.build/community/neoeinstein-tonic:v0.3.0 out: . opt: + - compile_well_known_types + - extern_path=.google.protobuf=::tendermint_proto::google::protobuf - no_server=true diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index e4634862..d31e99d7 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -28,6 +28,15 @@ const IBC_REV: &str = "v3.0.0"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.29.2"; +/// The xion commit or tag to be cloned and used to build the proto files +const XION_REV: &str = "main"; + +/// the tokenfactory commit or tag to be cloned and used to build the proto files +const TOKENFACTORY_REV: &str = "v0.50.3-wasmvm2"; + +/// the abstractaccount commit or tag to be cloned and used to build the proto files +const ABSTRACT_ACCOUNT_REV: &str = "2c933a7b2a8dacc0ae5bf4344159a7d4ab080135"; + // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. @@ -39,6 +48,12 @@ const COSMOS_SDK_DIR: &str = "../cosmos-sdk-go"; const IBC_DIR: &str = "../ibc-go"; /// Directory where the submodule is located const WASMD_DIR: &str = "../wasmd"; +/// Directory where the xion output is located +const XION_DIR: &str = "../xion"; +/// Directory where the tokenfactory output is located +const TOKENFACTORY_DIR: &str = "../tokenfactory"; +/// Directory where the abstract-account output is located +const ABSTRACT_ACCOUNT_DIR: &str = "../abstract-account"; /// A temporary directory for proto building const TMP_BUILD_DIR: &str = "/tmp/tmp-protobuf/"; @@ -76,22 +91,37 @@ 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"); + let temp_xion_dir = tmp_build_dir.join("xion"); + let temp_tf_dir = tmp_build_dir.join("tokenfactory"); + let temp_aa_dir = tmp_build_dir.join("abstract-account"); fs::create_dir_all(&temp_sdk_dir).unwrap(); fs::create_dir_all(&temp_ibc_dir).unwrap(); fs::create_dir_all(&temp_wasmd_dir).unwrap(); + fs::create_dir_all(&temp_xion_dir).unwrap(); + fs::create_dir_all(&temp_tf_dir).unwrap(); + fs::create_dir_all(&temp_aa_dir).unwrap(); update_submodules(); output_sdk_version(&temp_sdk_dir); output_ibc_version(&temp_ibc_dir); output_wasmd_version(&temp_wasmd_dir); + output_xion_version(&temp_xion_dir); + output_tf_version(&temp_tf_dir); + output_aa_version(&temp_aa_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); + compile_xion_proto_and_services(&temp_xion_dir); + compile_tokenfactory_proto_and_services(&temp_tf_dir); + compile_abstract_account_proto_and_services(&temp_aa_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")); + copy_generated_files(&temp_xion_dir, &proto_dir.join("xion")); + copy_generated_files(&temp_tf_dir, &proto_dir.join("tokenfactory")); + copy_generated_files(&temp_aa_dir, &proto_dir.join("abstract-account")); apply_patches(&proto_dir); @@ -199,6 +229,21 @@ fn update_submodules() { run_git(["submodule", "update", "--init"]); run_git(["-C", WASMD_DIR, "fetch"]); run_git(["-C", WASMD_DIR, "reset", "--hard", WASMD_REV]); + + info!("Updating xion submodule..."); + run_git(["submodule", "update", "--init"]); + run_git(["-C", XION_DIR, "fetch"]); + run_git(["-C", XION_DIR, "reset", "--hard", XION_REV]); + + info!("Updating tokenfactory submodule..."); + run_git(["submodule", "update", "--init"]); + run_git(["-C", TOKENFACTORY_DIR, "fetch"]); + run_git(["-C", TOKENFACTORY_DIR, "reset", "--hard", TOKENFACTORY_REV]); + + info!("Updating abstract-account submodule..."); + run_git(["submodule", "update", "--init"]); + run_git(["-C", ABSTRACT_ACCOUNT_DIR, "fetch"]); + run_git(["-C", ABSTRACT_ACCOUNT_DIR, "reset", "--hard", ABSTRACT_ACCOUNT_REV]); } fn output_sdk_version(out_dir: &Path) { @@ -216,6 +261,21 @@ fn output_wasmd_version(out_dir: &Path) { fs::write(path, WASMD_REV).unwrap(); } +fn output_xion_version(out_dir: &Path) { + let path = out_dir.join("XION_COMMIT"); + fs::write(path, XION_REV).unwrap(); +} + +fn output_tf_version(out_dir: &Path) { + let path = out_dir.join("TOKENFACTORY_COMMIT"); + fs::write(path, TOKENFACTORY_REV).unwrap(); +} + +fn output_aa_version(out_dir: &Path) { + let path = out_dir.join("ABSTRACT_ACCOUNT_COMMIT"); + fs::write(path, ABSTRACT_ACCOUNT_REV).unwrap(); +} + fn compile_sdk_protos_and_services(out_dir: &Path) { info!( "Compiling cosmos-sdk .proto files to Rust into '{}'...", @@ -244,6 +304,61 @@ fn compile_wasmd_proto_and_services(out_dir: &Path) { info!("=> Done!"); } +fn compile_xion_proto_and_services(out_dir: &Path) { + let sdk_dir = Path::new(XION_DIR); + let proto_path = sdk_dir.join("proto"); + let proto_paths = [ + format!("{}/proto/xion", sdk_dir.display()), + format!("{}/proto/xion/mint", sdk_dir.display()), + format!("{}/proto/xion/globalfee", sdk_dir.display()), + format!("{}/proto/xion/jwk", sdk_dir.display()), + + ]; + + // List available proto files + let mut protos: Vec = vec![]; + collect_protos(&proto_paths, &mut protos); + + // Compile all proto client for GRPC services + info!("Compiling xion proto clients for GRPC services!"); + run_buf("buf.sdk.gen.yaml", proto_path, out_dir); + info!("=> Done!"); +} + +fn compile_tokenfactory_proto_and_services(out_dir: &Path) { + let sdk_dir = Path::new(TOKENFACTORY_DIR); + let proto_path = sdk_dir.join("proto"); + let proto_paths = [ + format!("{}/proto/osmosis/tokenfactory", sdk_dir.display()), + ]; + + // List available proto files + let mut protos: Vec = vec![]; + collect_protos(&proto_paths, &mut protos); + + // Compile all proto client for GRPC services + info!("Compiling tokenfactory proto clients for GRPC services!"); + run_buf("buf.sdk.gen.yaml", proto_path, out_dir); + info!("=> Done!"); +} + +fn compile_abstract_account_proto_and_services(out_dir: &Path) { + let sdk_dir = Path::new(ABSTRACT_ACCOUNT_DIR); + let proto_path = sdk_dir.join("proto"); + let proto_paths = [ + format!("{}/proto/abstractaccount", sdk_dir.display()), + ]; + + // List available proto files + let mut protos: Vec = vec![]; + collect_protos(&proto_paths, &mut protos); + + // Compile all proto client for GRPC services + info!("Compiling abstract account proto clients for GRPC services!"); + run_buf("buf.sdk.gen.yaml", proto_path, out_dir); + info!("=> Done!"); +} + fn compile_ibc_protos_and_services(out_dir: &Path) { info!( "Compiling .proto files to Rust into '{}'...", @@ -354,6 +469,7 @@ 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 + // TODO(tarcieri): use prost-build/tonic-build config for this instead const REPLACEMENTS: &[(&str, &str)] = &[ // Use `tendermint-proto` proto definitions ("(super::)+tendermint", "tendermint_proto"), @@ -375,6 +491,14 @@ fn copy_and_patch(src: impl AsRef, dest: impl AsRef) -> io::Result<( "/// Generated server implementations.\n\ #[cfg(feature = \"grpc\")]", ), + // Use `tendermint_proto` as source of `google.protobuf` types + // TODO(tarcieri): figure out what's wrong with our `buf` config and do it there + ("::prost_types::", "::tendermint_proto::google::protobuf::"), + // add the feature flag to the serde definitions + ("impl serde::Serialize for", "#[cfg(feature = \"serde\")]\n\ + impl serde::Serialize for"), + ("impl<'de> serde::Deserialize<'de> for", "#[cfg(feature = \"serde\")]\n\ + impl<'de> serde::Deserialize<'de> for") ]; // Skip proto files belonging to `EXCLUDED_PROTO_PACKAGES` @@ -420,4 +544,22 @@ fn apply_patches(proto_dir: &Path) { ) .expect("error patching cosmos.staking.v1beta1.rs"); } + + for (pattern, replacement) in [ + ( + "stake_authorization::Validators::AllowList", + "stake_authorization::Policy::AllowList", + ), + ( + "stake_authorization::Validators::DenyList", + "stake_authorization::Policy::DenyList", + ), + ] { + patch_file( + &proto_dir.join("cosmos-sdk/cosmos.staking.v1beta1.serde.rs"), + &Regex::new(pattern).unwrap(), + replacement, + ) + .expect("error patching cosmos.staking.v1beta1.serde.rs"); + } } diff --git a/tokenfactory b/tokenfactory new file mode 160000 index 00000000..cb6fdfcf --- /dev/null +++ b/tokenfactory @@ -0,0 +1 @@ +Subproject commit cb6fdfcf37081503e1707f3f28344c5e726a86e5 diff --git a/xion b/xion new file mode 160000 index 00000000..4bb2b97b --- /dev/null +++ b/xion @@ -0,0 +1 @@ +Subproject commit 4bb2b97b43ae4d035e65505e2557b40e22521f68